Skip to content

Button

Buttons trigger actions. They support multiple variants, sizes, loading states, and icons.

Variants

Four visual variants for different levels of emphasis.

Sizes

Buttons come in sm, md, and lg sizes.

States

Loading, disabled, and full-width button states.

With Icons

Buttons can include leading or trailing icons.

Interactive

Pick a variant and size to see a live preview.

Variant
Size
Loading
Disabled
PropTypeDefaultDescription
variant"primary" | "secondary" | "ghost" | "danger""primary"Visual style of the button.
size"sm" | "md" | "lg""md"Size of the button.
loadingbooleanfalseShows a spinner and disables interaction while loading.
disabledbooleanfalsePrevents interaction when true.
fullWidthbooleanfalseStretches the button to fill its container.
iconLeftReactNodeIcon rendered before the label.
iconRightReactNodeIcon rendered after the label.
childrenReactNodeButton label content.

Related Components

Best Practices

✅ Do

  • Use primary for the main CTA
  • Use descriptive labels
  • Show loading state during async operations
  • Use iconLeft for actions like Save/Delete

❌ Don't

  • Put multiple primary buttons next to each other
  • Use vague labels like "Click Here"
  • Disable without explanation
  • Use ghost variant for important actions

Accessibility

FeatureSupport
KeyboardSpace/Enter to activate
Focus visible outlineVisible focus ring on keyboard navigation
aria-labelRequired for icon-only buttons
aria-disabledCommunicated to assistive technologies
role="button"Implicit on native button element