Skip to content

    Browse components

    Droplet Tabs

    A segmented control whose highlight stretches like a drop of liquid as it glides to the new option, then snaps tight. Arrow keys move it.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/droplet-tabs

    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/droplet-tabs.json

    Usage

    import { DropletTabs } from "@/components/ui/droplet-tabs";
    
    const [range, setRange] = useState("Week");
    
    <DropletTabs options={["Day", "Week", "Month", "Year"]} value={range} onValueChange={setRange} />

    Props

    PropTypeDefaultDescription
    optionsstring[]["Day","Week","Month","Year"]Option labels (also the values).
    stretchnumber0.6How much the highlight stretches while travelling.
    labelstring"Time range"Accessible name of the group.
    colorReactNode—Highlight color (defaults to the theme primary).
    valueReactNode—Controlled selected option. Pair with onValueChange.
    defaultValueReactNode—Initial option when uncontrolled (defaults to the first).
    onValueChangeReactNode—Called with the newly selected option.
    classNamestring—Extra classes for the root element.