Micro-interactions

Lever

An industrial breaker lever with a real over-centre mechanism. Displayed travel lags the raw pointer travel by a bump curve peaked at the threshold, so approaching it the handle drags heavier, and crossing it the lag collapses and the handle races ahead of the finger. That is why a half-hearted push falls back the way a real breaker does. Release projects the flick's velocity past the threshold before choosing a side, so momentum can finish a throw the finger only started, and the keyboard commits through exactly the same spring the hand uses. The throw is a motion value. React holds only the committed side.

Install

bun add motion

Props

PropTypeDefaultDescription
orientation"vertical" | "horizontal""vertical"Throw axis. Vertical reads as a breaker; horizontal as a transfer switch.
stiffnessnumber520Spring tension on the snap.
dampingnumber18Spring friction — low enough by default to overshoot and settle.
thresholdnumber0.5Breakover point of the throw.
resistancenumber0.6The hump — how hard the mechanism fights before it commits.
ledbooleantrueState lamp above the track.
labelsbooleantrueON / OFF stencils on the housing.
accentstring (hex)"#a855f7"The lamp, the lit end of the track, and the handle stripe.
sizenumber140Housing height (width when horizontal); internals scale on a fixed grid.

What It Demonstrates

Drag
Moving an element by grabbing it, often with momentum when released.
Spring
Motion driven by physics (tension, mass, damping) rather than a set duration.
Bounce
A spring that overshoots and settles, adding playfulness.
Stiffness / Tension
How strongly the spring pulls toward its target. Higher feels snappier.
Damping
How quickly a spring settles. Lower damping means more bounce and oscillation.

Related Components

Appears In