Slider

Documentation and examples for the Slider component.

When To Use

To input a value in a range.

Example Usage

Range & Tooltips

Enable range to allow selecting a minimum and maximum value, and pass an array to value. Adding tooltip will display the current values when interacting.

Variants & Slots

The Slider supports a tall variant for a thicker track. You can also customize the handler visual using the thumb slot.

How to Use

astro
---
import Slider from '@/components/data-entry/Slider.astro';

---
<Slider id="slider1" min={0} max={100} value={50} />

API

Property
Description
Type
Default

label

Label for the slider string

variant

Visual style variant 'default' | 'tall' 'default'

range

Enables dual-thumb range selection boolean false

value

Current value or array of two values for range number | [number, number] 50

min

Minimum value number 0

max

Maximum value number 100

step

Granularity of the slider number 1

tooltip

Shows the value in a tooltip boolean false

error

Indicates an error state or displays an error message string | boolean

success

Indicates a success state or displays a success message string | boolean

disabled

Disables the component boolean false