Stock
The stock
One choice. The rest stay quiet.
Selects one option from a group. The selected dot fills with ink.
The stock
One choice. The rest stay quiet.
Three ways in. They share one source, so the pixels match whichever you pick.
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.
npx @noorddev/vlak-cli add radio
The StyleX leaf lands in components/vlak/, for your own compiler to own. See StyleX.
npx shadcn add https://vlak.dev/r/radio.json
The same registry item, installed by shadcn's CLI.
<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>A real native radio inside a RadioGroup; the ink dot mirrors its state.
| Prop | Type | Default | Description |
|---|---|---|---|
valuerequired | string | ||
label | ReactNode |
Also accepts Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value">.
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | ||
value | string | ||
defaultValue | string | ||
onValueChange | (value: string) => void |
Also accepts Omit<HTMLAttributes<HTMLDivElement>, "onChange">.
| Keys | Does |
|---|---|
| Tab | Moves focus into the group, onto the checked radio |
| Arrow up, Arrow down, Arrow left, Arrow right | Moves the selection |
| Space | Selects the focused radio |
<label class="rs-radio"><span class="rs-radio-dot rs-radio-on"></span>Monthly</label>