Slider

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

Default

Sizes

Sizes

Colors

Colors

Radius

Radius

Installation

npm install @sunsatosolutions/ui

API

Props

AttributeTypeDefaultDescription
size"sm" | "md" | "lg""md"The size of the slider.
color"foreground" | "primary" | "secondary" | "success" | "warning" | "danger""primary"The color of the slider.
radius"none" | "sm" | "md" | "lg" | "full""full"The radius of the slider track and thumb.
defaultValuenumber[]-The value of the slider when initially rendered. Use when you do not need to control the state of the slider.
valuenumber[]-The controlled value of the slider. Must be used in conjunction with onValueChange.
namestring-The name of the slider. Submitted with its owning form as part of a name/value pair.
disabledbooleanfalseWhen true, prevents the user from interacting with the slider.
minnumber0The minimum value for the range.
maxnumber100The maximum value for the range.
stepnumber1The stepping interval.
orientation"horizontal" | "vertical""horizontal"The orientation of the slider.
dir"ltr" | "rtl""ltr"The reading direction of the slider. If omitted, inherits globally from DirectionProvider or assumes LTR.

Events

AttributeTypeDescription
onValueChange(value: number[]) => voidEvent handler called when the value changes.
onValueCommit(value: number[]) => voidEvent handler called when the value changes at the end of an interaction.