Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
Composition
<app-slider> ├── [appSliderLabel] (optional) ├── [appSliderControl] │ ├── [appSliderTrack] │ │ └── [appSliderRange] │ └── [appSliderThumb] │ ├── <input appSliderHiddenInput> (optional) │ └── [appSliderDraggingIndicator] (optional) ├── [appSliderMarkerGroup] (optional) │ └── [appSliderMarker] └── [appSliderValueText] (optional)
Examples
Autoscaling
Loading...
Color
Loading...
Default
Loading...
Disabled
Loading...
Inline
Loading...
Range
Loading...
Scrubber
Loading...
Vertical
Loading...
API Reference
<app-slider>
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
id | string | undefined | generated | Unique identifier used to create the slider part IDs. |
ids | SliderElementIds | undefined | — | Overrides the generated IDs for individual parts. |
aria-label | string[] | undefined | — | Accessible label for each thumb, in thumb order. |
aria-labelledby | string[] | undefined | — | ID reference providing an accessible label for each thumb. |
value | number[] | undefined | — | Values when controlled. Supports Angular two-way binding. |
defaultValue | number[] | undefined | [min] | Initial values when uncontrolled. |
disabled | boolean | false | Disables interaction with the slider. |
readOnly | boolean | false | Prevents changes while preserving focus and navigation. |
invalid | boolean | false | Marks the slider as invalid. |
name | string | undefined | — | Name used when submitting the value with a form. |
form | string | undefined | — | Associates the slider with a form by ID. |
min | number | undefined | 0 | Minimum allowed value. |
max | number | undefined | 100 | Maximum allowed value. |
step | number | undefined | 1 | Smallest permitted value increment. |
largeStep | number | undefined | 10 × step | Increment used by Page Up and Page Down. |
minStepsBetweenThumbs | number | undefined | 0 | Minimum number of steps allowed between adjacent thumbs. |
orientation | "horizontal" | "vertical" | undefined | "horizontal" | Sets the layout and keyboard navigation axis. |
origin | "start" | "center" | "end" | undefined | "start" | Point from which the filled range is drawn. |
thumbAlignment | SliderThumbAlignment | undefined | "contain" | Aligns thumbs inside or around the track bounds. |
thumbSize | { width: number; height: number } | undefined | — | Explicit thumb dimensions used for layout calculations. |
thumbCollisionBehavior | SliderThumbCollisionBehavior | undefined | "none" | Determines how thumbs behave when they meet. |
getAriaValueText | ((details: SliderValueTextDetails) => string) | undefined | — | Returns accessible text for a thumb value. |
Use [(value)]="value" for two-way binding, or combine [value] with (valueChange) when using
signals. The component also implements Angular's ControlValueAccessor for forms integration.
Outputs
| Output | Type | Description |
|---|---|---|
valueChange | number[] | undefined | Emits the current slider values. |
valueDetailsChange | SliderValueChangeDetails | Emits details whenever the values change. |
valueChangeEnd | SliderValueChangeDetails | Emits when pointer or keyboard adjustment ends. |
focusChange | SliderFocusChangeDetails | Emits when the focused thumb changes. |
[appSliderThumb]
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
index | number | required | Index of the value controlled by this thumb. |
name | string | undefined | — | Form name used by this thumb's hidden input. |
[appSliderMarker]
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
value | number | required | Value represented by this position marker. |
Context, Providers, and Utilities
| Export | Angular API |
|---|---|
SliderRootProvider | Directive that provides an externally created slider API through value. |
SliderContext | Structural directive [slider-context] exposing the root API to a template. |
useSlider(options) | Creates the signal-backed slider machine inside an injection context. |
injectSliderContext() | Injects the nearest slider root context. |
injectSliderThumbPropsContext() | Injects the props context for the nearest thumb. |
SliderImports | Readonly collection containing the slider UI and context helpers. |
Types
| Export | Description |
|---|---|
SliderApi | Connected slider state and actions. |
SliderElementIds | Overrides for generated slider part IDs. |
SliderThumbProps | Props used to identify a slider thumb. |
SliderMarkerProps | Props used to position a slider marker. |
SliderDraggingIndicatorProps | Props used by a dragging indicator. |
SliderThumbAlignment | Supported thumb alignment modes. |
SliderThumbCollisionBehavior | Supported behavior when slider thumbs collide. |
SliderValueTextDetails | Details passed to getAriaValueText. |
SliderValueChangeDetails | Details emitted by value-change outputs. |
SliderFocusChangeDetails | Details emitted by focusChange. |
SliderThumbPropsContext | Signal-backed props for the nearest thumb. |
UseSliderOptions | Options accepted by useSlider. |
UseSliderProps | Root props accepted by the slider machine. |
UseSliderReturn | Signal-backed slider machine returned by useSlider. |
Angular
React
Solid
Svelte
Vue