Skip to main content

Button

Button/Primary is a high‑emphasis button that initiates the primary action on a screen.

When to use

  • Use a button for primary actions that complete a task, such as submitting a form.
  • Use the Outline or Ghost style for secondary actions that are less critical than the primary button.
  • Use the Icon variant when space is limited and the action can be conveyed by an icon alone.
  • Use the Large size for prominent calls‑to‑action and Small size for inline or toolbar actions.

When not to use

  • Don't use a button for navigation; use a link component instead.
  • Don't use a button for toggling on/off states; use a Switch or Checkbox.
  • Don't use the Loading state without providing a visual indicator, such as a spinner, to convey progress.

Variants

Style

VariantDescriptionWhen to use
FilledSolid background with content color.Primary actions that need emphasis.
OutlineTransparent background with a visible border.Secondary actions that should appear less dominant.
GhostNo border, subtle background on hover.Minimal emphasis in dense UI areas.
IconIcon‑only button, no label.Compact toolbars or when an icon clearly conveys the action.

Color

VariantDescriptionWhen to use
PrimaryHighlights the main brand color.Default for most actions.
NeutralLow‑contrast, muted tone.Non‑critical actions.
ErrorRed tint indicating a destructive or error‑related action.Confirming deletions or error handling.
SuccessGreen tint for positive outcomes.Confirming successful operations.
WarningAmber tint for cautionary actions.Alerting users to potential issues.
InfoBlue tint for informational actions.Providing supplemental information.

State

VariantDescriptionWhen to use
DefaultRegular interactive state.Standard button behavior.
DisabledNon‑interactive, dimmed appearance.When the action is unavailable.
FocusVisible focus ring for keyboard navigation.Always present when the button receives focus.
HoverHighlight on pointer hover.Enhances discoverability.
LoadingShows a spinner and prevents interaction.While an asynchronous operation is in progress.
PressedDepressed visual feedback on activation.Provides tactile response during click/tap.

Size

VariantDescriptionWhen to use
LargeTallest height and widest padding.Prominent calls‑to‑action.
MediumBalanced height and padding.General‑purpose buttons.
SmallCompact height and minimal padding.Inline actions or toolbar buttons.

Props / API

PropTypeDefaultDescription
style"Filled" | "Outline" | "Ghost" | "Icon""Filled"Determines the visual style of the button.
color"Primary" | "Neutral" | "Error" | "Success" | "Warning" | "Info""Primary"Sets the semantic color theme.
state"Default" | "Disabled" | "Focus" | "Hover" | "Loading" | "Pressed""Default"Represents the visual state of the button.
size"Large" | "Medium" | "Small""Large"Controls the button’s size.

Accessibility

  • Ensure the button has an accessible name that describes its action, either via visible text or an aria-label.
  • The button must be reachable via keyboard and display a focus indicator when focused.
  • When state is Loading, provide an accessible label such as aria-busy="true" and include a visible spinner.
  • Use sufficient color contrast for the chosen color variant against its background, meeting WCAG AA minimums.
  • Do not rely on color alone to convey state; combine with text, icons, or ARIA attributes.

Changelog

  • 2026-07-01 — Initial doc generated from Figma.