A quiet moment
Focus
Keep notifications quiet
Notifications are quiet.
A native checkbox with a 64px pill track, translating thumb and a 44px hit height.
Notifications are 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 { IOSSwitch } from "@noorddev/vlak-react";Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/ios-switch.
npx @noorddev/vlak-cli add ios-switch
The StyleX leaf lands in components/vlak/, for your own compiler to own. See StyleX.
npx shadcn add https://vlak.dev/r/ios-switch.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 { IOSSwitch } from "@noorddev/vlak-react";
<IOSSwitch name="wifi" aria-label="Wi-Fi" defaultChecked onCheckedChange={checked => console.log(checked)} />The native checkbox owns focus, form submission and Space activation.
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | ||
defaultChecked | boolean | false | |
onCheckedChange | (checked: boolean) => void |
Also accepts Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "checked" | "defaultChecked" | "children">.
| Keys | Does |
|---|---|
| Tab, Shift+Tab | Moves focus to or away from an enabled switch. |
| Space | Toggles the native checkbox. |
<span class="rs-ios-switch"><span class="rs-ios-switch-track" aria-hidden="true"></span><span class="rs-ios-switch-thumb" aria-hidden="true"></span><input class="rs-ios-switch-input" type="checkbox" role="switch" aria-label="Wi-Fi" /></span>