Forms

Slider

@xui/slider

A draggable handle along a track for choosing a number in a range. Drag the handle or click the track; arrow keys step, Home/End jump to the bounds, and PageUp/PageDown take larger strides. Full ControlValueAccessor.

Install

pnpm add @xui/slider

Add the barrel to a standalone component's imports:

import { XuiSliderImports } from '@xui/slider';

@Component({
  imports: [XuiSliderImports],
  // …
})

Examples

Default

Loading preview…

Labelled

Loading preview…

Colors

Loading preview…

Disabled

Loading preview…

Vertical

Loading preview…

API

XuiSlider

componentxui-slider

A draggable value along a track, with an optional labelled axis.

Variants

AxisOptionsDefaultcolornoneprimarysuccesswarningerrorprimarydraggingtruefalsefalse

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the component's own rather than replacing them.''minnumberLower end of the range. Every value the slider takes is clamped to it.0maxnumberUpper end of the range. Every value the slider takes is clamped to it.10stepSizenumberThe granularity values snap to. Also how far one arrow key moves the handle.1labelStepSizenumberSpacing between rendered axis labels; 0 (or a falsy labelRenderer) hides them.1labelRendererXuiSliderLabelRendererFormat a tick value into its label, or false to hide the axis entirely.(value: number) => String(value)colorXuiSliderColorIntent colour of the track fill and the handle.this.config.colororientation'horizontal' | 'vertical'Run the track across (horizontal) or up the page (vertical). Also picks which arrow keys move the handle.this.config.orientationshowTrackFillbooleanFill the track up to the handle, rather than leaving it uniform.this.config.showTrackFilldisabledbooleanBlock interaction and dim the slider.falsevalueInputnumberThe current value. Two-way bindable with [(value)].0

Outputs

NameTypevalueChangenumberEmits the clamped, snapped value whenever it changes — from a drag, a key, or a track click.

Source

libs/ui/slider/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.