Button

Triggers an action. Solid primary or 1px ghost; 40px tall, 36px small.

Print

Studio / Alkmaar

Issue 03 goes on the press at 06:00. One primary per view.

Use it for

  • One primary action per view, with ghost for the secondary action.
  • Submitting a form or answering a dialog.

Not for

  • Navigation that changes the URL; use Link or a nav component.
  • On and off state; use Toggle or Switch, which carry aria-pressed and aria-checked.

Three ways in. They share one source, so the pixels match whichever you pick.

1. Import the package

npm install @noorddev/vlak-react

// once, next to your app's root
import "@noorddev/vlak-react/css";

import { Button } from "@noorddev/vlak-react";

Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/button.

2. Vendor the source

npx @noorddev/vlak-cli add button

The StyleX leaf lands in components/vlak/, for your own compiler to own. See StyleX.

3. Through shadcn

npx shadcn add https://vlak.dev/r/button.json

The same registry item, installed by shadcn's CLI.

CSS only

<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />

No React. Link vlak.css and use the markup and classes below.

import { Button } from "@noorddev/vlak-react";

<Button>Primary action</Button>
<Button variant="ghost" size="sm">Secondary</Button>
<Button disabled>Saving…</Button>

Button

PropTypeDefaultDescription
variant"primary" | "ghost""primary"Solid ink primary or hairline ghost. One primary per view.
size"default" | "sm""default"
groupedbooleanfalseFlush into a ButtonGroup: no own stroke, one ink seam.

Also accepts ButtonHTMLAttributes<HTMLButtonElement>.

KeysDoes
TabMoves focus to the button
Enter, SpaceActivates it
<button class="rs-btn-primary">Primary action</button>
<button class="rs-btn-ghost">Secondary</button>
.rs-btn-primary.rs-btn-ghost.rs-btn-sm.rs-btn-grouped.rs-btn-grouped-ghost