Skip to content

KSlider ​

Drag the slider within a fixed range.

Install ​

bash
pnpm add @ikun-ui/slider
bash
yarn add @ikun-ui/slider
bash
npm install @ikun-ui/slider

Basic usage ​

Vertical mode ​

Setting the vertical attribute to true enables vertical mode.

Disabled slider ​

Use disabled attribute to determine whether a slider is disabled.

Maximum and minimum values ​

The max and min attributes limit the maximum and minimum values of the slider

Custom Render slider ​

Rendering slider content using slots

Sizes ​

Add size attribute to change the size of Slider. It supports sm, md and lg.

Discrete values ​

Set step size with the step attribute. You can display breakpoints by setting the showStops attribute

Slider Props ​

NameTypeDefaultDescription
valuenumber0Binding value
verticalbooleanfalseVertical mode
format(value: number) => number | string(value: number) => valueTooltip format value
minnumber0Minimum value
maxnumber100Maximum value
stepnumber1Step size
showStopbooleanfalseDisplay breakpoints
disabledbooleanfalseWhether Slider is disabled
sizesm | md | lgmdSize of slider.
clsstring-Additional class
attrsRecord<string, string>{}Additional attributes

Slider Events ​

NameDescriptionType
changeFires when the value changes and the mouse is released(value: CustomEvent)=> void
inputTrigger in real time when data changes(value: CustomEvent)=> void

Slider Slots ​

NameDescription
buttonRenderCustomize slider button content

MIT Licensed