Selection and input

Slider

A value along a range, picked by dragging.

iOSSwiftUI SliderAndroidCompose SliderRenders in a Screen or an Island
iOSSwiftUI Slider
AndroidCompose Slider

Import

ts
import {Slider} from '@hzblj/kara-ui'

Examples

Stepped

tsx
<Slider max={10} min={0} onValueChange={setRating} step={1} value={rating} />

Props

SwiftUI Slider / Compose's Material Slider, tinted fill.accent.primary.

PropTypeDefaultDescription
value*number—

Between min and max. Controlled: pass back what onValueChange reports.

disabledbooleanfalse

Stops the user moving the thumb, and dims the slider.

maxnumber1

The upper end. 1 by default.

minnumber0

The lower end. 0 by default.

onValueChange(value: number) => void—

Called with the new value as the thumb moves.

stepnumber—

The increment between stops; leave it unset for a continuous slider. On Android every stop plays a tick.

value*
number

Between min and max. Controlled: pass back what onValueChange reports.

disabledfalse
boolean

Stops the user moving the thumb, and dims the slider.

max1
number

The upper end. 1 by default.

min0
number

The lower end. 0 by default.

onValueChange
(value: number) => void

Called with the new value as the thumb moves.

step
number

The increment between stops; leave it unset for a continuous slider. On Android every stop plays a tick.

Platform notes

  • A stepped slider ticks at every stop on Android; iOS 26’s slider plays its own.