Skip to content

    Browse components

    Stretch Tabs

    Segmented control whose pill indicator stretches like rubber toward the new option, thins out as it pulls, then snaps shut.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/stretch-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/stretch-tabs.json

    Usage

    import { StretchTabs } from "@/components/ui/stretch-tabs";
    
    <StretchTabs options={["Day", "Week", "Month"]} value={range} onChange={setRange} />

    Props

    PropTypeDefaultDescription
    optionsstring[]["Day","Week","Month","Year"]Segment labels.
    stretchnumber0.6How stretchy the indicator is.
    labelstring"View"Accessible name of the group.
    valueReactNode—Controlled selected option, pair with onChange.
    defaultValueReactNode—Initial option when uncontrolled (defaults to the first).
    onChangeReactNode—(value: string) => void.
    classNamestring—Extra classes for the root element.