Your schedule
Studio review10:30
A pill-shaped single choice with a full selected fill, radio semantics and arrow-key selection.
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 { IOSSegmentedControl } from "@noorddev/vlak-react";Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/ios-segmented-control.
npx @noorddev/vlak-cli add ios-segmented-control
The StyleX leaf lands in components/vlak/, for your own compiler to own. See StyleX.
npx shadcn add https://vlak.dev/r/ios-segmented-control.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 { IOSSegmentedControl } from "@noorddev/vlak-react";
<IOSSegmentedControl name="view" label="Calendar view" defaultValue="day" items={[{ id: "day", label: "Day" }, { id: "week", label: "Week" }, { id: "month", label: "Month" }]} />A mutually exclusive choice with one Tab stop and arrow-key selection.
| Prop | Type | Default | Description |
|---|---|---|---|
itemsrequired | IOSSegmentedControlItem[] | ||
value | string | ||
defaultValue | string | ||
onValueChange | (value: string) => void | ||
name | string | ||
form | string | ||
disabled | boolean | ||
label | string | "View" |
Also accepts Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange" | "children">.
| Keys | Does |
|---|---|
| Tab, Shift+Tab | Enters or leaves the group through its selected option. |
| Arrows, Home, End | Moves and selects enabled options; horizontal arrows respect text direction. |
| Enter, Space | Selects the focused option. |
<div class="rs-ios-segmented-control" role="radiogroup" aria-label="Calendar view"><button class="rs-ios-segmented-control-item rs-ios-segmented-control-selected" role="radio" aria-checked="true" tabindex="0">Day</button><button class="rs-ios-segmented-control-item" role="radio" aria-checked="false" tabindex="-1">Month</button></div>