Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

Slider

An input where the user selects a value from within a given range.

Installation

pnpm add @heyramzi/ui bits-ui

Usage

import { Slider } from "@heyramzi/ui/shadcn/slider";
<Slider type="single" bind:value max={100} step={1} thumbLabel="Volume" />

Keyboard and accessibility

Key Does
Arrow Right Arrow Up Raises the value by one step.
Arrow Left Arrow Down Lowers the value by one step.
Home Sets the minimum.
End Sets the maximum.
Cmd Arrow Right Cmd Arrow Up Jumps to the maximum.
Cmd Arrow Left Cmd Arrow Down Jumps to the minimum.
  • The thumb is the slider a screen reader hears. Name it with thumbLabel.
  • A range slider has one thumb per value, and each is its own Tab stop.

API reference

valueText string
Announced in place of the raw value, for a slider running on stop indices.
thumbLabel string
Names the thumb, which is the element carrying `role="slider"`.
ref bindable HTMLElement | null
Default null
value bindable Slider.Root
class string
...rest
Every prop of Slider.Root from bits-ui except child, children
Prop Type Default
valueText

Announced in place of the raw value, for a slider running on stop indices.

string
thumbLabel

Names the thumb, which is the element carrying `role="slider"`.

string
ref bindable HTMLElement | null null
value bindable Slider.Root
class string
...rest Every prop of Slider.Root from bits-ui except child, children