Veil UI
Components

Range Slider

A two-thumb slider for selecting a numeric range.

Installation

$ npx veil-ui@latest add range-slider

Usage

import { RangeSlider } from "@/components/ui/range-slider";

<RangeSlider defaultValue={[20, 80]} min={0} max={100} aria-label="Price range" />;

Examples

Basic

20 – 80

Stepped

$0Selected $20–$60$100+

API reference

The package exports range-slider along with its composable parts. It forwards standard attributes to its root element; see the examples above for the component-specific props.

Accessibility

  • Each thumb is independently focusable with full keyboard support and exposes its own value.
  • Error and disabled states are exposed through native attributes and Radix data attributes.
  • Focus-visible rings follow the shared token system in both themes.

Vue and plain HTML

This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add range-slider --framework vue or switch the framework in components.json.

<script setup lang="ts">
import { Slider } from "@/components/ui/slider";

defineOptions({ inheritAttrs: false });
</script>

<template>
  <Slider v-bind="$attrs" :min-steps-between-thumbs="1" />
</template>

On this page