HextaUI

Slider: Disabled

The whole slider dims and ignores pointer and keyboard input.

Bass boost
30
import { Slider, SliderLabel, SliderValue } from "@/components/ui/slider"

export function SliderDisabled() {
  return (
    <Slider defaultValue={30} disabled className="max-w-xs">
      <SliderLabel>Bass boost</SliderLabel>
      <SliderValue />
    </Slider>
  )
}

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

pnpm dlx shadcn@latest add https://hextaui.com/r/slider-disabled.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[]–
disabled
booleanfalse
className
string | (state) => string–

Every prop is in the Slider API reference.

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