Tac UIv1.1.2

Slider

A range input that lets users select a numeric value within a defined min/max range.

Import

tsx
import { Slider } from '@tac-ui/native';

Playground

Interactively configure the Slider props below.

tsx
<Slider defaultValue={50} min={0} max={100} />

Default

The base slider renders a styled range input with a filled track and an animated thumb that scales on press interactions.

tsx
<Slider defaultValue={50} min={0} max={100} />

Unfilled

Set filled={false} to render the track as a flat secondary color without the progressive fill, useful when the position alone conveys the value.

tsx
<Slider defaultValue={50} min={0} max={100} filled={false} />

With Label and Value Display

Pass label to render a heading above the track. Enable showValue to display the current numeric value aligned to the right of the label in real time.

Volume
40
tsx
<Slider
  label="Volume"
  showValue
  defaultValue={40}
  min={0}
  max={100}
  step={1}
/>

API Reference

PropTypeDefaultDescription
labelstring-Label displayed above the slider.
showValuebooleanfalseDisplays the current value next to the label.
filledbooleantrueFills the track up to the current value with the primary color.
valuenumber-Controlled current value.
defaultValuenumber-Default value for uncontrolled usage.
minnumber0Minimum value of the range.
maxnumber100Maximum value of the range.
stepnumber1Increment step between values.
onChange(value: number) => void-Called when the value changes.
onChangeEnd(value: number) => void-Called when the user releases the thumb.
disabledbooleanfalseDisables the slider when true.
styleViewStyle-Additional styles applied to the container.