Component packs › Switchyard › Railway Lever
Grab it and the catch lifts out of its notch; the heavy lever lags your hand, swings over and drops into the far notch with a clunk.
Railway Lever 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: heavy lever physics, latch and notch, drag or click.
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 |
|---|---|---|---|
number | string | "14" | Number on the lever's plate. Default "14". |
positions | [string, string] | ["Normal", "Reverse"] | Printed names of the two positions. Default ["Normal", "Reverse"]. |
import RailwayLever from './RailwayLever';
<RailwayLever />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Skeuomorphic UI.