Component packs › Plumb › Spirit Level Toggle
Turn it on and the bar sets down flat while the bubble drifts through the fluid to rest between the lines, stretching as it moves.
Spirit Level Toggle is a toggle from Plumb, a component pack with 6 measuring controls: Range sliders, angle pickers and loaders built from measuring tools. Price: $2 for the whole pack.
Built with: viscous bubble, bar settles with a rock, moving contact shadow.
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 |
|---|---|---|---|
checked | boolean | ||
disabled | boolean | ||
label | string | Accessible name, e.g. "Snap to grid". | |
onChange | (checked: boolean) => void | ||
autoplay | number | false | Showcase mode: toggles itself every N ms while visible. |
readonly checked: booleansetChecked(v: boolean, silent?: boolean): voiddestroy(): voidimport SpiritLevelToggle from './SpiritLevelToggle';
<SpiritLevelToggle />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Sliders.