Component packs › Switchyard › Safety Cover
Lift the hinged guard, then throw the switch; drop the guard and it pushes the switch off on the way down.
Safety Cover is a toggle from Switchyard, a component pack with 8 toggle switches: Toggle switches that work like the real hardware: rockers, bolts, breakers, keys and levers. Price: $2 for the whole pack.
Built with: two-step guard, guard forces off, hinged 3D cover.
Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.
| Prop | Type | Default | Description |
|---|---|---|---|
coverTurnsOff | boolean | Closing the cover pushes the switch off (true, like aircraft guards) or leaves it as it is. | |
coverLabel | string | "Lift the safety cover" | Accessible name of the cover button. Default "Lift the safety cover". |
readonly open: booleansetOpen(open: boolean): voidimport SafetyCover from './SafetyCover';
<SafetyCover />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Skeuomorphic UI.