Slider

An easily stylable range input.

Installation

pnpm dlx shadcn@latest add @lumi-ui/slider

Recipes

Range Slider

Edge Aligned Thumbs

By default, the slider thumb is centered on the value. This means at 0% and 100%, half of the thumb hangs outside the track's bounds.

Use thumbAlignment="edge" to keep the entire thumb contained inside the track boundaries. This is useful when:

  1. The slider is flush against a screen edge or container wall.
  2. The parent container has overflow: hidden (which would otherwise clip half the thumb).
ModeVisual Behavior
center (Default)The center of the thumb aligns with the start/end. The thumb overflows the track by 50% of its width.
edgeThe outer edge of the thumb aligns with the start/end. The thumb stays 100% inside the track.

Vertical Slider