Skip to content

Slider

<ax-slider> is a token-styled wrapper over a native <input type="range">. It implements ControlValueAccessor, so it works with [(value)], [(ngModel)], and reactive forms.

import { AxSliderComponent } from '@axisui-ng/forms';
<ax-slider [(value)]="volume" [min]="0" [max]="100" [step]="5" ariaLabel="Volume" />
<!-- screen-reader-friendly valuetext -->
<ax-slider [(value)]="percent" [format]="pctFormat" ariaLabel="Progress" />
pctFormat = (v: number) => `${v}%`;
InputTypeDefaultNotes
valuemodel<number>0Two-way value ([(value)]); also CVA.
minnumber0Minimum.
maxnumber100Maximum.
stepnumber1Increment.
disabledbooleanfalseDisabled (also via CVA setDisabledState).
ariaLabelstring''Accessible label.
format((value: number) => string) | nullnullOptional formatter for aria-valuetext (e.g. v => v + '%').

Backed by a native range input: arrow keys adjust the value, Home/End jump to the bounds, and aria-valuemin / aria-valuemax / aria-valuenow are exposed automatically. Always provide ariaLabel (or a wrapping label). Use format when the raw number needs a spoken unit.

Interactive examples live in Storybook under Forms / Slider. Run pnpm storybook to explore them.