Button
Trigger an action or event, such as submitting a form or opening a dialog.
Sizes
The default size is md.
Variants
Primary is the default. Give each group of actions one primary; supporting actions use secondary or tertiary.
All variants and sizes in comparison
Shapes
Rounded is the default; pill is for marketing and onboarding surfaces.
Icon only
Pass iconOnly with a text size: xs is 24×24, and sm through xl match the text button heights. Pill makes it a circle. Icon-only buttons need an aria-label that names the action and its target.
Prefix and suffix
Place icons directly beside the label. Source order sets the side, and the padding on that side tightens by 2px.
Keys
Show the shortcut that runs the action. A string is one chip; an array is one chip per key.
Disabled
Link
Link variants sit inline with text. Pass render={<a href />} when the button navigates.
Best practices
When to use
- Use Button for actions that change something: save, deploy, delete. When it navigates to a new URL, use a link variant with render={<a href />}.
- Use Split Button when one action is the clear default and a few close variants belong next to it. Use Dropdown when the actions are unrelated.
- Give each group of actions one primary. Supporting actions use secondary or tertiary; keep brand for upgrade and marketing moments.
- Use Toggle or Switch when the control holds a persistent state rather than running an action.
Behavior
- Disable a button only when the action is impossible right now, such as missing input or permission, and say why nearby or in a Tooltip.
- Pass keys only for a shortcut the product actually binds. The chip is the hint, not the listener. A string is one chip; an array is one chip per key.
Content
- Name what happens with Verb + Noun in sentence case: “Deploy agent”, “Invite member”, “Rotate key”. Avoid bare verbs like “Submit” and generic confirms like “OK”.
- Destructive actions use danger or danger-subtle and name the object: “Delete agent”, not “Delete”.
Accessibility
- Icon-only buttons need an aria-label that names the action and its target, like “Copy agent ID”, not the icon, like “Copy”.
- Do not set aria-label on a button with visible text; it replaces the label for screen readers.
- The keys chip is decorative. The label stays the accessible name.