Components / Button

Button

Buttons trigger actions. ALPHA ships variants spanning emphasis levels and intents, plus sm/md/lg sizes — composed from a single base via class variants.

Variants

Every variant is the same base button with a different emphasis and intent. Pick by the weight the action deserves in its context, not by colour.

VariantWhen to use
defaultPrimary action. One per view.
flatPrimary action without elevation, for dense toolbars.
secondarySupporting action beside a primary button.
destructiveIrreversible action — pair with a confirmation step.
outlineLow-emphasis action that still needs a visible boundary.
outlineFlatOutline without elevation, for grouped controls.
ghostMinimal action inside dense layouts and menus.
ghostSecondaryMuted ghost for tertiary actions.
ghostDestructiveDestructive action in a low-emphasis position.
linkInline navigation styled as text.
iconSquare icon-only button — pair with aria-label.

Sizes

Size is geometry only — it never changes what an action means.

SizeWhen to use
sm32px control height for dense UI.
md40px default control height.
lg48px height for prominent placements.

States

The focus ring is driven by :focus-visible, so it appears for keyboard navigation and stays out of the way for pointer users — tab to a button below to see it.

StateWhen to use
disabledDrops to 45% opacity and leaves the tab order.
loadingShows a spinner, sets aria-busy and blocks interaction, so a pending action cannot be double-submitted.

Props

PropTypeDefaultNotes
variantButtonVariant"default"Emphasis and intent. See the variant table above.
size"sm" | "md" | "lg""md"Control height. Geometry only — never changes intent.
disabledbooleanfalseNon-interactive, 45% opacity.
loadingbooleanfalseShows a spinner, sets aria-busy and blocks interaction.
asChildbooleanfalseRender the child element instead of a <button>, keeping the styling.

Guidelines

  • Use exactly one default button per view — competing primaries erase the hierarchy.
  • Reserve destructive for irreversible actions, and always pair it with a confirmation step.
  • Icon-only buttons must carry an aria-label; the glyph is not an accessible name.