Skip to content
Theme:

Ui3nSlider ​

Slider component for selecting numeric values with customizable appearance.

Props

NameTypeDefaultDescription
idstring | undefined —

Root element id

namestring | undefined —

HTML name attribute for form submission

modelValue*number | [number, number] —

Current slider value

stepstring | number | undefined —

Slider step

rangeboolean | undefined —

Whether slider is range

minstring | number | undefined0

Minimum value

maxstring | number | undefined100

Maximum value

labelVisible"normal" | "always" | "never" | undefined"normal"

Label visibility

labelTextColorstring | undefined"var(--color-text-block-darkery-default)"

Label text color

labelColorstring | undefined"var(--color-bg-block-tritery-default)"

Label color

activeColorstring | undefined —

Active color

trackColorstring | undefined —

Track color

trackHeightstring | number | undefined —

Track height

thumbSizestring | number | undefined —

Thumb size

thumbColorstring | undefined —

Thumb color

transformValueMethod((value: number) => string) | undefined —

Transform value method

disabledboolean | undefined —

Whether slider is disabled

Events

Event NameArguments / Value TypeDescription
update:modelValuevalue: number | [number, number] —

Public Methods & Exposes

Method NameSignature / TypeDescription
clear()() => void —

CSS Variables

Set any of these where you need it — on :root, on a container, or on the element itself through [data-ui3n] — and the component follows. Leave them alone and it uses the defaults below.

NameDefault
--ui3n-slider-active-colorvar(--color-bg-control-accent-default)
--ui3n-slider-heightmax(var(--_slider-track-height), var(--_slider-thumb-size))
--ui3n-slider-pointer1-position0
--ui3n-slider-pointer2-position0
--ui3n-slider-thumb-colorvar(--color-bg-control-accent-default)
--ui3n-slider-thumb-size16px
--ui3n-slider-track-colorvar(--color-bg-control-secondary-default)
--ui3n-slider-track-height8px

Usage Examples ​

Simple slider ​

Simple slider

Basic slider with default settings

Value: 50

Slider with custom range ​

Slider with custom range

Slider with custom min, max and step values

25

Value: 25

Range slider ​

Range slider

Slider with range mode for selecting two values

Range: 20 - 80