Button
A versatile button component built on Base UI with support for different variants, sizes, icons, and color tones.Import
Props
The visual style variant of the button.Options:
primary- Filled accent color backgroundsecondary- Subtle gray backgroundtertiary- Glass-like appearance with shadow and blurghost- Transparent background, visible on hoverlink- Appears as a link with accent colorlink-neutral- Appears as a link with neutral colordanger- Destructive action styling with red background
The size of the button.Options:
xs- 28px height (var(—space-28))s- 32px height (var(—space-32))m- 36px height (var(—space-36))l- 40px height (var(—space-40))
Icon element displayed before the button text. Automatically sized based on the button size.
Icon element displayed after the button text. Automatically sized based on the button size.
Color tone applied to text when using certain variants.Feedback tones:
default- No tone appliedinfo- Information bluewarning- Warning amberdanger- Error redsuccess- Success green
red,orange,amber,yellow,lime,green,emeraldteal,cyan,sky,blue,indigo,violet,purplefuchsia,pink,rose
When true, disables interaction and applies disabled styling.
Additional CSS classes to apply to the button.
Explicit escape hatch for intentional structural overrides. Use with caution.
Usage
Basic Button
Variants
Sizes
With Icons
Icon-Only Button
With Tone
Disabled State
Accessibility
- Built on Base UI’s
Buttonprimitive with full keyboard support - Focus ring uses utility-focus-inner (1px) and utility-focus-outer (3px) for clear visibility
- Icons are automatically hidden from assistive technology when label text is present
- When using icon-only buttons, always provide an
aria-labelattribute - Active state includes a subtle scale animation (0.98) for tactile feedback
- Disabled buttons use
cursor-not-allowedand reduced opacity
Design Tokens
The Button component uses the following design tokens: Colors:actions-primary-default,actions-primary-hover,actions-primary-disabledactions-secondary-default,actions-secondary-hover,actions-secondary-disabledactions-tertiary-default,actions-tertiary-hover,actions-tertiary-disabledactions-danger-default,actions-danger-hover,actions-danger-disabledcontent-strong,content-subtle,content-disabledcontent-on-accent-strong,content-on-accent-disabledcontent-link-default,content-link-hover
- Heights:
space-28,space-32,space-36,space-40 - Horizontal padding:
space-10,space-12,space-16 - Gap between elements:
space-2,space-4 - Icon sizes:
space-16,space-18
- Border radius:
radius-max(fully rounded) - Font weight:
font-weight-medium - Focus ring:
utility-focus-inner,utility-focus-outer