Skip to content

Button

Primary action control with primary/ghost/danger variants and a small size cut.

Preview

Variants Primary, ghost, danger, small.

<button class="nx-btn nx-btn--primary">Save</button> <button class="nx-btn nx-btn--ghost">Cancel</button> <button class="nx-btn nx-btn--danger nx-btn--sm">Delete</button>

API

React props (NxKit)

React (NxKit) props
PropTypeDefaultRequiredDescription
variant"primary"|"ghost""primary"Visual weight — danger/sm are CSS-only modifiers, applied via className.

Classes

Framework-agnostic classes
ClassDescription
.nx-btnBase
.nx-btn--primaryAccent fill
.nx-btn--ghostOutline
.nx-btn--dangerDestructive, solid-fill token
.nx-btn--smSmall size cut

States

disabled

loading

Accessibility

  • Native <button>; :focus-visible ink outline; :disabled dims + not-allowed cursor.
  • Loading state: wrap the label in .nx-btn__label + add a .nx-spinner child and aria-busy="true" plus an aria-label describing the pending action.

Do / Don’t

  • Do: Use one primary per view.Don’t: Don't put accent-600 text on an accent-50 fill.

View in spec →