HextaUI

Slider: Sizes

sm, default and lg scale the thumb and track together.

import { Slider } from "@/components/ui/slider"

export function SliderSizes() {
  return (
    <div className="flex w-full max-w-xs flex-col gap-8">
      <Slider size="sm" defaultValue={25} aria-label="Small" />
      <Slider defaultValue={50} aria-label="Default" />
      <Slider size="lg" defaultValue={75} aria-label="Large" />
    </div>
  )
}

This adds the example as components/examples/slider/sizes.tsx, together with the Slider component and the HextaUI theme tokens it needs.

pnpm dlx shadcn@latest add https://hextaui.com/r/slider-sizes.json

To add only the component, follow the Slider installation.

Props in this example

The Slider props this example sets, from the API reference.

PropTypeDefault
defaultValue
number | number[]–
size
"sm" | "default" | "lg""default"
aria-labelNames the thumbs.
string–

Every prop is in the Slider API reference.

See them all, with keyboard support and accessibility notes, on the Slider page.