Aliases
cta, action button
ButtonAction button or link with variants, sizes, and a loading state.
Aliases
cta, action button
Foundations
Button for primary and secondary actions.link variant for an action with text-link styling.loading while an action runs and disabled when an action is unavailable.Button for passive navigation lists or inline text links inside paragraphs.interactive container
root Carries the main action styling, spacing, and state transitions.
text label
label Communicates the action in plain language.
supporting icon slot
leading Adds emphasis or direction before the label.
supporting icon slot
trailing Adds continuation or disclosure after the label.
loading indicator
spinner Replaces the icon/leading slot during loading states.
| Name | Type | Default | Description |
|---|---|---|---|
variant | 'solid' | 'soft' | 'outline' | 'ghost' | 'link' | 'destructive' | 'solid' | Chooses the visual action recipe. |
size | 'xs' | 'sm' | 'md' | 'lg' | 'md' | Chooses the compiled size recipe. |
href | string | — | When provided, renders the button as an anchor element. |
as | 'button' | 'a' | 'button' | Explicitly chooses the underlying interactive element. |
type | 'button' | 'submit' | 'reset' | 'button' | Native button type when rendered as a button. |
disabled | boolean | false | Disables activation and updates semantics accordingly. |
loading | boolean | false | Shows the loading state and suppresses activation. |
iconOnly | boolean | false | Switches the component into icon-only mode. |
ariaLabel | string | — | Required accessible label when iconOnly is true. |
target | string | — | Anchor target when rendering as a link. |
rel | string | — | Anchor relationship attributes when rendering as a link. |
onClick | (event: MouseEvent) => void | — | Receives native activation for buttons and links; disabled and loading states suppress activation. |
theme | ThemeContract | — | Sets the theme used to resolve component styles. |
| Name | Payload | Description |
|---|---|---|
click | MouseEvent | Forwards native activation to legacy on:click handlers. |
| Name | Description |
|---|---|
default | Primary visible label content. |
leading | Optional icon or symbol before the label. |
trailing | Optional icon or symbol after the label. |
Variants
solid: Highest-emphasis action for the main next step.soft: Filled secondary action.outline: Bordered action with a surface-colored fill.ghost: Low-emphasis action for denser surfaces.link: Text-link styling within the button layout.destructive: Destructive action styling.Sizes
xs / sm: Compact sizes for dense UI and supporting actions.md: Default button scale for most product surfaces.lg: Higher-emphasis action size for spacious or touch-focused contexts.States
rest: Default compiled appearance.hover: Color or shadow changes on hover, depending on the variant.focus-visible: Visible keyboard focus treatment using the system focus ring.pressed: Subtle active-state shift without scale distortion.disabled: Visually and semantically non-interactive state.loading: Loading indicator with activation disabled.Semantics
href or as="a" is supplied.aria-disabled behavior for anchors.Keyboard
Screen readers
ariaLabel in icon-only mode.Caveats
ariaLabel so the action remains understandable to assistive technology.Checklist
Implementation notes
MouseEvent. Call preventDefault() to cancel the default action.The default solid medium button for the main next step.
<Button variant="solid" size="md">Continue</Button> Use destructive plus loading when the outcome is risky and asynchronous.
<Button variant="destructive" loading={true}>Delete project</Button> Icon-only mode keeps the target size while shrinking the visual footprint.
<Button variant="ghost" iconOnly={true} ariaLabel="Open settings">⚙</Button> ariaLabel in icon-only mode.Calculated fixtures; browser evidence is not collected. Layout estimates use declared text behavior and maximum token values.
content=label|size=md|variant=solid
content=label|size=md|variant=soft
content=label|size=md|variant=outline
content=label|size=md|variant=ghost
content=label|size=md|variant=link
content=label|size=md|variant=destructive
content=label|size=xs|variant=solid
content=label|size=sm|variant=solid
content=label|size=lg|variant=solid
content=icon-only|size=md|variant=solid
content=icon-only|size=lg|variant=solid
content=label|size=md|variant=destructive
content=label|size=md|variant=link