Components
Loading preview...
A switch allows a user to turn a setting on or off. There is no native HTML element with switch styling. <input type="checkbox"> is the closest semantically, but isn't styled or exposed to assistive technology as a switch. Switch helps achieve accessible switches that can be styled as needed.
@jolbol1
npx shadcn@latest add https://21st.dev/r/jolbol1/switchimport { Switch } from "@/components/ui/switch"
export function SwitchDemo() {
return <Switch>Low power mode</Switch>
}