Toggle Sidebar B
AppearanceLight & dark mode D

Slosh Gauge

Tank gauge whose liquid chases the value with mass, tilts with its own speed and splashes against the top when it slams full; optionally a vertical slider.

Default

Drag the tank, or focus it and use the arrow keys, to set the level. The presets under it jump to a value so you can watch the liquid settle.

Dark previewReplay previewOpen in new tab

Customize

Value60
Liquid
Glass
Width88px
Height180px
Radius20px
Ticks4
Viscosity0.15
Tilt0.45
Splash0.42

API Reference

SloshGauge

PropTypeDefaultDescription
modelValuenumberundefinedThe level, 0 to 100, as v-model. Every change launches the liquid toward it. Leave it undefined to run uncontrolled.
defaultValuenumber60The starting level when uncontrolled.
interactivebooleanfalsePress or drag the tank to set the level, arrows to step. A marker appears at the level.
showValuebooleantrueA readout whose colour flips at the surface.
disabledbooleanfalseDimmed and inert. Value changes still animate.
liquidColorstring'#f5f5f5'The liquid. The readout over it picks dark or light by itself.
glassColorstring'#27272a'The tank.
widthnumber88Tank width in px. The readout scales with it.
heightnumber180Tank height in px.
radiusnumber20Corner radius in px, capped at half the smaller side.
ticksnumber4Lines etched on the right of the glass. 0 hides them.
viscositynumber0.150 is a rigid gauge. Higher is slower to answer, longer to settle, and overshoots more.
tiltnumber0.45How far the surface leans per unit of speed. 0 keeps it flat.
splashnumber0.42How much of a slam the top and bottom give back. 0 swallows it, 0.8 nearly bounces.
unitstring'%'Readout suffix.
ariaLabelstring'Level'Accessible name of the meter or slider.
EventDescription
update:modelValueThe integer level on press, on each change while dragging, and on keys. Interactive only.

Accessibility

Keyboard shortcuts and ARIA behavior.

Shortcut Description
ArrowUp + ArrowRightRaise the level by 2. Hold Shift for 10.
ArrowDown + ArrowLeftLower the level by 2. Hold Shift for 10.
PageUp + PageDownRaise or lower the level by 10.
Home + EndJump to 0 or 100.
EscapeCancels a drag and restores the level it started from.
  • Static, it is a meter. With interactive on it becomes a vertical slider and takes focus.
  • With prefers-reduced-motion the liquid follows the value without overshoot or tilt.