Component packs › Switchyard › Safety Cover

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.

Safety Cover props

PropTypeDefaultDescription
coverTurnsOffbooleanClosing the cover pushes the switch off (true, like aircraft guards) or leaves it as it is.
coverLabelstring"Lift the safety cover"Accessible name of the cover button. Default "Lift the safety cover".

Methods on the ref

Use it in React

import SafetyCover from './SafetyCover';

<SafetyCover />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Switchyard

Good for: Skeuomorphic UI.