Button
A wrapper around React Aria’s Button component. Handles keyboard, mouse, and touch
activation with full accessibility support.
Add via CLI
Section titled “Add via CLI”npx @a2ra/cli add buttonVariants
Section titled “Variants”Disabled state
Section titled “Disabled state”Example JSON
Section titled “Example JSON”{ "type": "Button", "props": { "variant": "primary", "size": "md" }, "children": "Save changes"}| Prop | Type | Description |
|---|---|---|
variant | primarysecondary defaultdangerghost | Visual style |
size | smmd defaultlg | Button size |
isDisabled | truefalse default | Prevents interaction and applies disabled styles |
isPending | truefalse default | Shows a loading indicator; disables the button |
type | button defaultresetsubmit | HTML button type |
name | string | Form field name |
value | string | Form field value |
children | stringnode[] | Button label text or child nodes |
- Use
type: "submit"inside aFormnode to trigger form submission. isPendingdisables the button and shows a spinner; use it while an async action is running.variant: "ghost"renders no background or border; suitable for icon buttons inside toolbars.