Skip to content

Buttons

.nw-btn is the one button class. Intent, variant, size and motif are separate modifiers that compose, so nw-btn nw-btn-outline nw-btn-danger nw-btn-sm is an outlined, small, danger button. With no modifiers you get a solid, primary, medium button.

Always set type="button" on a <button> that is not meant to submit a form. The same classes work on an <a> for navigation.

<div class="nw-cluster">
<button type="button" class="nw-btn nw-btn-solid">Solid</button>
<button type="button" class="nw-btn nw-btn-soft">Soft</button>
<button type="button" class="nw-btn nw-btn-outline">Outline</button>
<button type="button" class="nw-btn nw-btn-ghost">Ghost</button>
<button type="button" class="nw-btn nw-btn-link">Link</button>
</div>
Class Effect
nw-btn Base button: layout, type, hairline border, focus ring. Defaults to solid, primary, medium.
nw-btn-solid Filled with the intent color and its on-accent ink (the default).
nw-btn-soft A tinted wash of the intent. The text mixes the intent with the foreground so it stays AA on the tint.
nw-btn-outline Transparent, with a full-strength intent border; the text is the intent color, which keeps 4.5:1 on plain surfaces in every flavor. On hover it takes the soft tint.
nw-btn-ghost No fill or border until hover. Its bloom goes to the text, not a halo.
nw-btn-link Underlined text without padding or fixed height; it glows in its text on hover.

An intent class sets the color the variant uses.

<div class="nw-cluster">
<button type="button" class="nw-btn nw-btn-primary">Primary</button>
<button type="button" class="nw-btn nw-btn-secondary">Secondary</button>
<button type="button" class="nw-btn nw-btn-tertiary">Tertiary</button>
<button type="button" class="nw-btn nw-btn-neutral">Neutral</button>
<button type="button" class="nw-btn nw-btn-info">Info</button>
<button type="button" class="nw-btn nw-btn-success">Success</button>
<button type="button" class="nw-btn nw-btn-warning">Warning</button>
<button type="button" class="nw-btn nw-btn-danger">Danger</button>
</div>
<div class="nw-cluster">
<button type="button" class="nw-btn nw-btn-outline nw-btn-danger">Outline danger</button>
<button type="button" class="nw-btn nw-btn-soft nw-btn-success">Soft success</button>
<button type="button" class="nw-btn nw-btn-ghost nw-btn-info">Ghost info</button>
<button type="button" class="nw-btn nw-btn-soft nw-btn-neutral">Soft neutral</button>
</div>
Class Color
nw-btn-primary The active accent: indigo, or the accent named by the nearest data-accent (default).
nw-btn-secondary Synth.
nw-btn-tertiary Ice.
nw-btn-neutral The foreground ink. A solid neutral button is a quiet inverted one; its other variants stay readable on any surface.
nw-btn-info Arc.
nw-btn-success Matrix.
nw-btn-warning Volt.
nw-btn-danger Alarm.
<div class="nw-cluster">
<button type="button" class="nw-btn nw-btn-xs">Extra small</button>
<button type="button" class="nw-btn nw-btn-sm">Small</button>
<button type="button" class="nw-btn nw-btn-md">Medium</button>
<button type="button" class="nw-btn nw-btn-lg">Large</button>
</div>
<div class="nw-cluster">
<button type="button" class="nw-btn nw-btn-outline nw-btn-sm">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 2 3 14h9l-1 8 10-12h-9l1-8z"/></svg>
Boost uplink
</button>
<button type="button" class="nw-btn nw-btn-soft">
Deploy
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg>
</button>
</div>
Class Height Horizontal padding Type Radius
nw-btn-xs 1.75rem 0.625rem text-xs sm
nw-btn-sm 2rem 0.75rem text-sm sm
nw-btn-md 2.5rem 1rem text-sm (default) md
nw-btn-lg 3rem 1.25rem text-base lg

A direct child <svg> is sized and spaced by the button and inherits the text color; put it before or after the label.

nw-btn-icon makes the button square (its width equals the size’s height). An icon-only button has no text, so it needs an aria-label.

<div class="nw-cluster">
<button type="button" class="nw-btn nw-btn-icon nw-btn-xs" aria-label="Add node"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M5 12h14M12 5v14"/></svg></button>
<button type="button" class="nw-btn nw-btn-icon nw-btn-sm nw-btn-soft" aria-label="Add node"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M5 12h14M12 5v14"/></svg></button>
<button type="button" class="nw-btn nw-btn-icon nw-btn-outline" aria-label="Add node"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M5 12h14M12 5v14"/></svg></button>
<button type="button" class="nw-btn nw-btn-icon nw-btn-lg nw-btn-ghost nw-btn-neutral" aria-label="Close"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg></button>
<button type="button" class="nw-btn nw-btn-icon nw-btn-soft nw-btn-danger" aria-label="Delete node"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 7h16M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3"/></svg></button>
</div>

nw-btn-block stretches a button to the width of its container. nw-btn-group joins adjacent buttons into one segmented control: inner corners square off, borders collapse and joined solid buttons keep a visible seam. Put role="group" and an aria-label on it; aria-pressed marks the held segment.

<div class="nw-stack">
<button type="button" class="nw-btn nw-btn-block nw-btn-secondary">Block button</button>
<div class="nw-cluster">
<div class="nw-btn-group" role="group" aria-label="Range">
<button type="button" class="nw-btn" aria-pressed="true">Day</button>
<button type="button" class="nw-btn" aria-pressed="false">Week</button>
<button type="button" class="nw-btn" aria-pressed="false">Month</button>
</div>
<div class="nw-btn-group" role="group" aria-label="Alignment">
<button type="button" class="nw-btn nw-btn-outline nw-btn-sm">Left</button>
<button type="button" class="nw-btn nw-btn-outline nw-btn-sm">Center</button>
<button type="button" class="nw-btn nw-btn-outline nw-btn-sm">Right</button>
</div>
</div>
</div>
Class Effect
nw-btn-icon Square, icon-only button.
nw-btn-block Full-width button.
nw-btn-group Container that joins child .nw-btn elements; the hovered or focused one rises above its neighbors so its ring shows.

The Nyxwire motifs are opt-in modifiers. nw-btn-cut chamfers the top-right and bottom-left corners by --nw-cut; the chamfer is painted, not clipped, so a glow follows it through a drop-shadow filter. nw-btn-wire draws the indigo-to-synth gradient edge over an opaque fill; on a cut button the wire becomes the chamfered edge. nw-btn-glow keeps a medium bloom on at rest instead of only on hover.

<div class="nw-cluster">
<button type="button" class="nw-btn nw-btn-cut">Cut</button>
<button type="button" class="nw-btn nw-btn-cut nw-btn-glow">Cut and glow</button>
<button type="button" class="nw-btn nw-btn-cut nw-btn-outline nw-btn-secondary">Cut outline</button>
<button type="button" class="nw-btn nw-btn-wire nw-btn-ghost">Wire</button>
<button type="button" class="nw-btn nw-btn-wire nw-btn-cut nw-btn-soft">Wire and cut</button>
<button type="button" class="nw-btn nw-btn-glow nw-btn-success">Glow success</button>
</div>
<div class="nw-cluster">
<button type="button" class="nw-btn nw-btn-cut nw-btn-lg" style="--nw-cut: 16px">Custom --nw-cut</button>
</div>
Class / property Effect
nw-btn-cut Chamfered corners. The cut size scales with the button size (8px up to sm, 10px at md, 12px at lg).
nw-btn-wire Gradient edge from primary to secondary. The state rules that swap the border color cannot erase it.
nw-btn-glow A resting neon bloom in the intent color. On a cut button it is a drop-shadow that follows the chamfer.
--nw-cut Set inline to override the chamfer of one button, for example style="--nw-cut: 16px".

The CSS keys on these attributes and pseudo-classes; there are no state classes. Every state only swaps the button’s paint, so its height, padding and width never change.

<div class="nw-cluster">
<button type="button" class="nw-btn" disabled>Disabled</button>
<button type="button" class="nw-btn nw-btn-soft" aria-disabled="true">aria-disabled</button>
<button type="button" class="nw-btn nw-btn-outline" disabled>Disabled outline</button>
</div>
<div class="nw-cluster">
<button type="button" class="nw-btn" aria-busy="true"><span>Saving</span></button>
<button type="button" class="nw-btn nw-btn-soft nw-btn-info" aria-busy="true"><span>Loading</span></button>
<button type="button" class="nw-btn nw-btn-outline nw-btn-success" aria-busy="true"><span>Syncing</span></button>
</div>
<div class="nw-cluster">
<button type="button" class="nw-btn nw-btn-outline" aria-pressed="true">Pressed (aria-pressed)</button>
<button type="button" class="nw-btn nw-btn-ghost nw-btn-neutral" aria-pressed="false">Not pressed</button>
<button type="button" class="nw-btn nw-btn-soft" aria-expanded="true">Expanded trigger</button>
</div>
Selector Effect
:hover A small bloom plus the variant’s hover paint: solid lightens, outline takes the soft tint, ghost the raised panel fill. Not applied to disabled, aria-disabled or busy buttons.
[aria-expanded="true"], [data-state="open"] A trigger whose popup is open keeps its hover paint.
:active The pressed fill, and the bloom drops. Under reduced motion the press does not move.
[aria-pressed="true"], [aria-checked="true"], [aria-selected="true"], [data-state="on"] Held on: the pressed fill survives the pointer leaving, for toggle buttons and segmented groups.
:focus-visible The 2px --nw-ring focus ring, offset 2px. It is drawn outside the chamfer on a cut button.
:disabled Quiet fill and ink, not-allowed cursor, no pointer feedback.
[aria-disabled="true"] The same look for an element that must stay focusable. Block the action yourself; the attribute does not stop clicks.
[aria-busy="true"] Loading: the label keeps its slot but is hidden, a ring spins over it and pointer input is ignored. Wrap the text in a child element such as a <span>.
  • Use <button> for actions and <a href> for navigation, even when they look the same.
  • Prefer aria-busy="true" to swapping the label for a spinner: the button keeps its width and its accessible name.
  • In forced-colors mode the cut and wire paint fall back to a system-colored box with a real border, and held states use Highlight.
  • The Vue NwButton shares this spec; see the Vue components.