Radio

Selects one option from a group. The selected dot fills with ink.

Stock

The stock

One choice. The rest stay quiet.

Use it for

  • One choice from two to six visible options.
  • Choices that should all be readable at once.

Not for

  • Many options; use Select.
  • Independent on and off choices; use Checkbox.

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 { Radio, RadioGroup } from "@noorddev/vlak-react";

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

2. Vendor the source

npx @noorddev/vlak-cli add radio

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/radio.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 { useState } from "react";
import { Radio, RadioGroup } from "@noorddev/vlak-react";

const [plan, setPlan] = useState("monthly");

<RadioGroup aria-label="Billing" value={plan} onValueChange={setPlan}>
  <Radio value="monthly" label="Monthly" />
  <Radio value="yearly" label="Yearly" />
</RadioGroup>

Radio

A real native radio inside a RadioGroup; the ink dot mirrors its state.

PropTypeDefaultDescription
valuerequiredstring
labelReactNode

Also accepts Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value">.

RadioGroup

PropTypeDefaultDescription
namestring
valuestring
defaultValuestring
onValueChange(value: string) => void

Also accepts Omit<HTMLAttributes<HTMLDivElement>, "onChange">.

KeysDoes
TabMoves focus into the group, onto the checked radio
Arrow up, Arrow down, Arrow left, Arrow rightMoves the selection
SpaceSelects the focused radio
<label class="rs-radio"><span class="rs-radio-dot rs-radio-on"></span>Monthly</label>
.rs-radio.rs-radio-dot.rs-radio-on.rs-radio-fill