Component packs › Plumb › Spirit Level Toggle

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.

Spirit Level Toggle props

PropTypeDefaultDescription
checkedboolean
disabledboolean
labelstringAccessible name, e.g. "Snap to grid".
onChange(checked: boolean) => void
autoplaynumber | falseShowcase mode: toggles itself every N ms while visible.

Methods on the ref

Use it in React

import SpiritLevelToggle from './SpiritLevelToggle';

<SpiritLevelToggle />

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

More in Plumb

Good for: Sliders.