Components
Button
Text button in four contract variants (plus danger ghost) and three sizes (plus xl), with icons and a loading state.
Usage
Use it to:
- trigger an action: save, create, confirm, open a menu
primaryonce per view for the main action;dangerto confirm destructive actions
Don’t use it to:
- navigate between pages (use Link, or Button
asChildwith a link when it must look like a button) - an icon without text (use IconButton)
Installation
Install the package (React 19):
terminal
terminal
terminal
Import the styles once, in your app entry or root layout:
/src/main.tsx
Use it anywhere inside your app's <Theme> (see Installation):
/src/ButtonExample.tsx
Examples
Variants
Size
With icon
Loading
The spinner replaces the content without changing the width; clicks are ignored and aria-busy is set.
Disabled
Full width
As a link
Use asChild to put the button styles on your own element, such as a link.
Dark theme
API Reference
Button
A <button>; supports all of its props. Adds:
| Prop | Type | Default |
|---|---|---|
variant | "primary""secondary""ghost""danger""danger-ghost" | "ghost" |
size | "sm""md""lg""xl" | "md" |
icon | IconName | |
trailingIcon | IconName | |
loading | boolean | false |
full | boolean | false |
type | "button""submit""reset" | "button" |
disabled | boolean | false |
asChild | boolean | false |
Accessibility
Tabfocuses the button;EnterandSpaceactivate it. The blue focus ring shows on keyboard focus.- Defaults to
type="button", so it never submits a form by accident; passtype="submit"for the form’s main action. loadingkeeps the accessible name, setsaria-busyandaria-disabled, and keeps focus on the button.- Icon-only actions need a name: use IconButton. On touch screens every button is at least 24×24.
© 2026 Motion. Internal documentation.