120k

Slider

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

Installation

pnpm dlx shadcn@latest add @force-ui-svelte/slider

Usage

<script lang="ts">
  import { Slider } from "$lib/components/ui/slider/index.js";
  let value = $state(33);
</script>
<Slider type="single" bind:value max={100} step={1} />

Examples

Range

Use an array with two values for a range slider.

Multiple Thumbs

Use an array with multiple values for multiple thumbs.

Vertical

Use orientation="vertical" for a vertical slider.

Controlled

Disabled

Use the disabled prop to disable the slider.

RTL

To enable RTL support in Force UI, see the RTL configuration guide.

API Reference

See the Radix UI Slider documentation.