label | string · requiredAccessible label. Rendered as visible text by default; used as aria-label when isIconOnly is true. |
|---|
variant | 'primary' | 'secondary' | 'ghost' | 'destructive' · default 'secondary'Visual style variant. |
|---|
size | 'sm' | 'md' | 'lg' · default 'md'Size variant. |
|---|
elevation | 'none' | 'low' | 'med' | 'high' · default 'none'Resting shadow depth for floating buttons (e.g. a FAB). none is the default flat button; low/med/high map to the shadow token scale. Ignored inside a ButtonGroup, where elevation is owned by the group. |
|---|
type | 'button' | 'submit' | 'reset' · default 'button'HTML button type attribute. |
|---|
name | stringHTML name attribute for form submission. |
|---|
value | string | number | readonly string[]HTML value attribute for form submission. |
|---|
form | stringAssociates the button with a form element by ID. |
|---|
isLoading | boolean · default falseShows a loading spinner and disables interaction. Announces "Loading" via a live region. |
|---|
isInterruptible | boolean · default falseKeep the button clickable while a clickAction is pending: the spinner and aria-busy still show, but the button is not disabled and the action is not deduped, so a re-click lands and interrupts the in-flight action with a fresh one. |
|---|
isDisabled | boolean · default falseDisables the button. When a tooltip is present, uses aria-disabled instead of native disabled so the button stays focusable. |
|---|
icon | ReactNodeIcon element rendered before the label text. An Astryx Icon with no explicit size defaults to sm for sm/md buttons and md for lg buttons. |
|---|
isIconOnly | boolean · default falseWhen true, renders as a square icon-only button with label as aria-label. Requires icon. Tip: for a dedicated icon-only button component, use IconButton from '@astryxdesign/core/IconButton' instead. |
|---|
width | SizeValueWidth of the button. Numbers are treated as pixels, strings are used as-is (e.g., '100%' for a full-width button). By default the button sizes to its content. |
|---|
children | ReactNodeOptional override for visible text. When provided, displayed instead of label, but label is still required (it provides the accessible name). For most cases, just use label alone: <Button label="Save" />. |
|---|
endContent | ReactElement<IconProps> | ReactElement<BadgeProps>Trailing icon or badge rendered after the label. Ignored when isIconOnly is true. Color is inherited from the button variant. |
|---|
tooltip | string |
|---|
onClick | (e: MouseEvent) => voidStandard click handler (passed through from ButtonHTMLAttributes). |
|---|
clickAction | (e: MouseEvent) => void | Promise<void>Async click handler. Shows loading state while the returned promise is pending. |
|---|
href | stringWhen provided, renders the button as a link element (<a> or custom link component). The destination follows the shared navigation rule described on the Link href prop. |
|---|
as | ComponentTypeCustom link component to use when href is provided (e.g. Next.js Link). |
|---|
target | stringHTML target attribute when rendered as a link (e.g. "_blank"). |
|---|
rel | stringHTML rel attribute when rendered as a link (e.g. "noopener noreferrer"). |
|---|