Skip to content

    Browse components

    Tank Gauge

    Round liquid gauge whose level springs to each new value and sloshes side to side before settling, with the readout inverting where the liquid covers it. Drag or key it to set the level.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/tank-gauge

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/tank-gauge.json

    Usage

    import { TankGauge } from "@/components/ui/tank-gauge";
    
    <TankGauge value={storage} onChange={setStorage} color="#38bdf8" />

    Props

    PropTypeDefaultDescription
    defaultValuenumber62Initial level when uncontrolled.
    colorstring"#38bdf8"Liquid color.
    sizenumber208Diameter in px.
    sloshnumber1How much the liquid sloshes.
    interactivebooleantrueLet the user drag or key the level (slider); off makes it a meter.
    labelstring"Tank level"Accessible name.
    valueReactNode—Controlled level 0-100, pair with onChange.
    onChangeReactNode—(value: number) => void.
    classNamestring—Extra classes for the root element.