createSlider API
API reference for the createSlider composable.
Explore these related pages for additional context and usage patterns.
(options?: SliderOptions) => SliderContextCreates slider state with value math, step snapping, and multi-thumb support.
Extends createModel for useProxyModel compatibility. Each thumb is a model
ticket with a shallowRef<number> value. Values are derived from the ordered
tickets, enabling proper registration/unregistration lifecycle.
number | undefinedMinimum value.
Default: 0
number | undefinedMaximum value.
Default: 100
number | undefinedStep increment. Values are snapped to the nearest multiple of `step` above `min`.
Default: 1
MaybeRefOrGetter<boolean> | undefinedWhether the slider is disabled.
MaybeRefOrGetter<boolean> | undefinedWhether the slider is readonly (focusable but not editable).
MaybeRefOrGetter<"horizontal" | "vertical"> | undefinedSlider orientation.
MaybeRefOrGetter<boolean> | undefinedFlip the percent axis.
number | undefinedMinimum steps required between adjacent thumbs.
Default: 0
boolean | undefinedAllow thumbs to pass through each other.
Default: false
boolean | undefinedRange mode — expects two thumbs.
Default: false
ComputedRef<number[]>Ordered thumb values derived from model tickets.
ComputedRef<number[]>Alias for `values` — provides useProxyModel compatibility.
Readonly<Ref<boolean, boolean>>Whether disabled. Reactive ref derived from the `disabled` option.
Readonly<Ref<boolean, boolean>>Whether readonly. Reactive ref derived from the `readonly` option.
Readonly<Ref<"horizontal" | "vertical", "horizontal" | "vertical">>Slider orientation. Reactive ref derived from the `orientation` option.
Readonly<Ref<boolean, boolean>>Whether inverted. Reactive ref derived from the `inverted` option.
numberMinimum steps required between adjacent thumbs.
booleanWhether thumbs can cross each other.
booleanWhether this is a range slider.
(values: unknown[], options?: { multiple?) => voidApply external values — snaps, constrains, and writes to ticket refs.
(input?: number | { value) => SliderTicketRegister a new thumb and return its ticket.
(id: ID) => voidUnregister a thumb by ticket ID.
(value: number) => numberRound a value to the nearest step, clamped to min/max.
(value: number) => numberConvert a value to a 0–100 percentage.
(percent: number) => numberConvert a 0–100 percentage to a snapped value.
(index: number, value: number) => voidSet the value at a thumb index with step snapping and neighbor constraints.
(index: number, multiplier?: number) => voidIncrement a thumb's value by `step × multiplier`.
(index: number, multiplier?: number) => voidDecrement a thumb's value by `step × multiplier`.
(index: number) => voidSet a thumb to the minimum value.
(index: number) => voidSet a thumb to the maximum value.