Skip to main content

Slider

A Slider component for displaying current value and intervals in range.

When To Use#

To input a value in a range.

Examples#

import { Slider } from 'tailor-ui';

Basic usage#

30
40

Range usage#

30
70
40
60

Customized min & max usage#

130
240
300

Customized step usage#

20
30
60

Disabled#

30
40
60

API#

PropertyDescriptionTypeDefault
valueThe value of slider. When range is false, use number, otherwise, use [number, number]number | [number, number]
defaultValueThe default value of slider. When range is false, use number, otherwise, use [number, number]number | [number, number]
minThe minimum value the slider can slide tonumber0
maxThe maximum value the slider can slide tonumber100
stepThe granularity the slider can step through values. Must greater than 0, and be divided by (max - min)number1
rangedual thumb modebooleanfalse
disabledIf true, the slider will not be interactable.booleanfalse
onChangeCallback function that is fired when the user changes the slider's value.(value: number \| [number, number]) => void