Skip to content

    Browse components

    Slider

    Single or range slider with springy thumbs, a value bubble, tick marks with labels, glide-to-click and full keyboard support (arrows, Page Up/Down, Home/End).

    Open
    Customize
    auto
    always
    never

    Installation

    npx shadcn@latest add @glint-ui/slider

    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/slider.json

    Usage

    import { Slider } from "@/components/ui/slider";
    
    <Slider defaultValue={[64]} />
    <Slider defaultValue={[20, 80]} step={10} marks formatValue={(v) => `$${v}`} />

    Props

    PropTypeDefaultDescription
    minnumber0Lowest value.
    maxnumber100Highest value.
    stepnumber1Increment between values.
    tooltip"auto" | "always" | "never""auto"Value bubble on hover/drag/focus, always, or never.
    marksbooleanfalseTick per step (up to 20), or pass values with labels.
    disabledbooleanfalseDisable interaction.
    defaultValueReactNode—number[]: one value per thumb, two for a range.
    formatValueReactNode—(v) => string for the bubble and aria-valuetext.
    nameReactNode—Form field name; one hidden input per thumb.
    classNamestring—Extra classes for the root element.