Background sync
- Keep this device up to date
Documents will sync in the background.
A Material switch with a 52-by-32 track and an expanding thumb, built on a native checkbox.
Documents will sync in the background.
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 { AndroidSwitch } from "@noorddev/vlak-react";Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/android-switch.
npx @noorddev/vlak-cli add android-switch
The StyleX leaf lands in components/vlak/, for your own compiler to own. See StyleX.
npx shadcn add https://vlak.dev/r/android-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 { AndroidSwitch } from "@noorddev/vlak-react";
<label htmlFor="sync">Background sync</label>
<AndroidSwitch id="sync" name="sync" checked={enabled} onCheckedChange={setEnabled} />| Prop | Type | Default | Description |
|---|---|---|---|
onCheckedChange | (checked: boolean) => void |
Also accepts Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size">.
| Keys | Does |
|---|---|
| Tab | Focuses the switch when enabled. |
| Space | Toggles the switch. |
<label for="android-sync">Background sync</label> <input class="rs-android-switch rs-android-switch-checked" id="android-sync" name="sync" type="checkbox" role="switch" checked aria-checked="true" />