Switch
Base UIA square switch with a real switch role.
Install
$ npx shadcn@latest add https://spotcheckui.com/r/switch.jsonAlso installs @base-ui/react.
Usage
import { Switch } from "@/components/spotcheck/switch"
<Switch checked={stream} onCheckedChange={setStream}>Stream responses</Switch>Props
- children
ReactNodeDefault —The visible label. - className
stringDefault —
Keyboard
| Space | Turn on or off |
|---|
Reduced motion
The knob moves at once.