Skip to content

    Browse components

    Rubber Range

    Range slider whose track stretches like rubber when dragged past either end, then springs back. Keyboard accessible.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/rubber-range

    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/rubber-range.json

    Usage

    import { RubberRange } from "@/components/ui/rubber-range";
    
    <RubberRange defaultValue={50} max={100} leftIcon={<Volume />} rightIcon={<Volume2 />} />

    Props

    PropTypeDefaultDescription
    defaultValuenumber50Starting value.
    minnumber0Lowest value.
    maxnumber100Highest value.
    stepnumber1Value increment.
    stretchnumber28Max px the track stretches past an end.
    showValuebooleantrueShow the value under the track.
    labelstring"Volume"Accessible name.
    leftIconReactNode—Icon at the low end.
    rightIconReactNode—Icon at the high end.
    onValueChangeReactNode—Called with the new value.
    classNamestring—Extra classes for the root element.