MiComponents/Documentation

Slider

A component for selecting a value from a range with draggable thumb and optional range.

Installation

npx micomponents-cli add slider

Preview

Usage

Import

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

Basic Usage

<Slider
  defaultValue={[50]}
  max={100}
  step={1}
/>

Range Slider

Select a range with two thumbs.

Selected: 20 - 80

Custom Step

Set custom step values for the slider.

Value: 50

API Reference

PropTypeDefaultDescription
defaultValuenumber[][50]The default value of the slider
minnumber0The minimum value of the slider
maxnumber100The maximum value of the slider
stepnumber1The step size when moving the slider