A glass that fills as you drag, with a surface that behaves like water.
FreeWeb and MobileMotion
Preview
npx shadcn add @fetaui/liquid-sliderPlaygroundWater today
DefaultWater today
LowWater today
Drink up
FullWater today
Goal reached
DisabledWater today
Colors
Icons animation
Disabled
Motion
Installation
Terminal· bash
npx shadcn add @fetaui/liquid-slider
Accessibility
- The glass is a vertical slider with a text value that includes the unit and the goal.
- Low and Full are announced.
- Focus rings the glass in ink.
Motion
- The level rises on a 220 and 26 spring, and the digits roll.
- The surface is 34 small springs that rest when the energy is gone, so no loop runs when idle.
- Dragging bulges the water up to 14 px under the pointer, and bubbles rise.
- Release and keys slosh: the surface tilts with pointer speed and throws three drops.
- Full stamps a badge from .6 on a 500 and 22 spring.
- With reduced motion, the surface is flat, the level steps, and no bubbles rise.
Responsive behavior
- A 120 by 212 glass in a 400 card on Web, and 112 by 202 at full width on Mobile.
- Narrower than 358, the reading moves above the glass.
Performance
- The surface is 34 springs in typed arrays, and the frame loop stops when their energy is gone.
- The water, surface and bubbles are set directly with setAttribute, not through React.
- Rising bubbles run only during a drag, as CSS, and pause offscreen.
Note for AI
Give your coding assistant the Markdown reference instead of screenshots.
- Import
LiquidSliderfrom@/components/fetaui/liquid-slider. - It defaults to water: 0 to 2000 in steps of 50, in ml. Set
label,unit,maxandstepfor anything else. maxis shown as the goal, and reaching it showsfullText. BelowlowAtit showslowText.colortakes any CSS color and recolors the water only; the glass stays ink. The docs offer the chart palettes' lead colors:var(--feta-blue-400),var(--feta-violet-400)andvar(--feta-orange-400).- The demo saves nothing. Read
onValueChange.
Related
SliderComponentPick a value or a range by dragging. Line for forms, Bold for a headline value, Field for dense inspectors, all with one or two thumbs.Liquid GaugeComponentA quota as liquid in a circle: it rises to its level, sloshes and settles.Detent DialComponentA rotary control that clicks into steps.Activity RingsComponentThree goal rings in ink tones. Hover isolates one ring and its legend, and closing all three shows a success Badge.