Skip to content

Button

Native ref-forwarding action control with primary, ghost, outline and danger variants.

View as Markdown

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"|"outline"|"danger""primary"Visual weight and destructive-action styling.
size"sm"|"md"|"lg"|"icon""md"Shared control dimensions; icon buttons still need an accessible name.

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 put accent-600 text on an accent-50 fill.

View in spec