primitives/@yashiel/mihcm-ui·v0.1.0·stable

Button

Primary action affordance. Six variants, four sizes. Universal across web and native.

Use cases

  • Primary call-to-action (variant="default") — one per region, the most important action.
  • Destructive confirmation (variant="destructive") — delete, archive. Always pair with a confirm flow.
  • Secondary action alongside a primary (variant="outline" or variant="secondary").
  • Inline action without a strong border (variant="ghost").
  • Link-styled action within prose (variant="link").

When NOT to use

  • For navigation that is purely a link with no side effect → use a <Link/> directly.
  • For toggle state → use a Toggle / Switch (planned).

Variants

VariantUse when
defaultThe primary action in a context. One per region.
destructiveConfirming a destructive action (delete, archive).
outlineSecondary alongside a primary.
secondaryAlternative when "outline" is too quiet for the brand context.
ghostTertiary, in toolbars, low-density rows.
linkInline within prose, where a button would feel heavy.

Sizes

SizeHeightUse when
sm32pxDense toolbars, secondary actions in tables.
md40pxDefault for most desktop UIs.
lg44pxMobile primary actions (44px touch-target rule).
icon40×40Icon-only square. Always pair with aria-label.

Composition

  • Pair with leadingIcon / trailingIcon (from @yashiel/mihcm-icons) for affordance.
  • For loading states, use isLoading — sets aria-busy and disables interaction.
  • For disabled states, use disabled directly. The visual treatment is the same as loading; aria-busy is the differentiator for assistive tech.
  • Text — typography primitive.
  • Planned: IconButton, ButtonGroup, Toggle.