Slider
Native numeric selection with single and range values, logical orientation, precise steps, complete Forms support and headless visual ownership.
GET STARTED
Import
Import the canonical standalone control from its granular entry point.
Single value
Bind the Signal model directly. showValue renders the normalized value while fluid fills the available width.
Bounds, steps and labels
Min and max normalize reversed bounds. Step is positive and valueLabel can present a domain-specific visual value.
Two-thumb range
Range keeps an ordered tuple, prevents thumb crossover and moves the nearest thumb when its track is clicked.
No committed interaction yet.
Horizontal and vertical
Vertical orientation changes the native writing mode and keeps its value increasing from bottom to top.
All Angular Forms adapters
The same value control works with Signal Forms, Reactive Forms and template-driven forms.
Signal Forms
Reactive Forms
ngModel
States and Field composition
Disabled leaves interaction, readonly remains focusable without hover feedback, and Field supplies shared invalid and fluid state.
Disabled
Readonly
Invalid
Interaction lifecycle
slideStart and slideEnd describe pointer motion; valueCommit reports a native change or a committed range-track click with the active thumb.
Logical RTL behavior
Native single controls follow document direction. Range track clicks also measure from logical start, so right-to-left layouts choose the expected value.
Unstyled and typed slots
Native inputs, normalized values and structural range layers stay intact while Tailwind owns the visual layer.
ACCESSIBILITY
Native range semantics
Each thumb remains a native input rather than a synthetic drag surface.
Native semantics
Browsers expose min, max, step and current value from input[type=range]. The visual fill does not replace the native control.
Keyboard
Arrow keys adjust by step, Page Up and Page Down make larger changes, and Home and End reach the bounds.
Range thumb names
Two thumbs require distinct names such as Minimum budget and Maximum budget. Both inputs share descriptions and validation state.
Human-readable values
Use ariaValueText for single values and the two range aria-value-text inputs when raw numbers do not communicate units or meaning.
Readonly versus disabled
Readonly preserves focus and blocks pointer and keyboard mutation. Disabled uses the native disabled state and suppresses hover feedback.
Field state
Slider inherits deterministic ids, descriptions, invalid, disabled, readonly, fluid and unstyled state from NeuralField.
PUBLIC API
Slider contracts
Canonical exports include the complete single, range, thumb and event type surface.
Inputs and model
| Input | Type | Default | Purpose |
|---|---|---|---|
| value | model<number | [number, number]> | 0 | Single value or ordered range tuple. |
| range | boolean | false | Renders two native range thumbs. |
| min / max | number | 0 / 100 | Normalized inclusive numeric bounds. |
| step | number | 1 | Positive interaction increment. |
| orientation | 'horizontal' | 'vertical' | 'horizontal' | Visual and ARIA orientation. |
| showValue | boolean | false | Displays the normalized value beside the control. |
| valueLabel | string | '' | Overrides visible output text. |
| rangeStartAriaLabel / rangeEndAriaLabel | string | '' | Distinct accessible names for range thumbs. |
| rangeStartAriaValueText / rangeEndAriaValueText | string | '' | Human-readable range thumb values. |
| disabled / readonly / invalid | boolean | false | Interaction and validation states. |
| touched / dirty | boolean | false | Forms state parity inputs. |
| name / sliderId | string | '' | Native name and deterministic id. |
| ariaLabel / ariaLabelledBy / ariaValueText | string | '' | Single-thumb accessible naming and value description. |
| fluid | boolean | false | Fills available inline size. |
| unstyled | boolean | false | Removes NeuralNg visual classes. |
| sliderClass / inputClass | string | '' | Additive root and native input classes. |
| classes | NeuralSliderClasses | {} | Typed root, input, output and range-layer slots. |
Outputs
valueChangeNeuralSliderValueGenerated model output for every value update.
slideStartNeuralSliderEventPointer interaction begins.
slideEndNeuralSliderEventPointer interaction ends.
valueCommitNeuralSliderEventNative change or range-track selection commits.
touchvoidA native thumb loses focus.
Methods
focus(options?)voidFocuses the first native thumb.
reset()voidRestores min, or [min,max] in range mode.
Typed class slots
rootComplete control and optional output layout.
inputSingle input or both native range inputs.
valueVisible value output.
rangeTwo-thumb positioning surface.
trackRange track.
fillSelected interval between thumbs.
Public types
NeuralSliderValuenumber | NeuralSliderRangeValue
NeuralSliderRangeValue[number, number]
NeuralSliderThumb'start' | 'end'
NeuralSliderOrientation'horizontal' | 'vertical'
NeuralSliderEvent{ value; originalEvent; thumb? }
NeuralSliderClassesTyped root, input, value, range, track and fill slots.
Legacy alias
SliderComponent remains deprecated for compatibility. New code and AI context use NeuralSlider.
DESIGN TOKENS
Slider tokens
Neutral, dark mode and custom themes share one semantic slider contract.
Layout
--neural-slider-widthComponent inline size.
--neural-slider-gapSpacing between component items.
--neural-slider-vertical-heightVertical block size.
--neural-slider-fontComponent font shorthand.
Track and fill
--neural-slider-track-sizeTrack width and height.
--neural-slider-track-radiusTrack corner radius.
--neural-slider-track-backgroundTrack background surface.
--neural-slider-fill-backgroundFill background surface.
--neural-slider-fill-background-invalidInvalid fill background surface.
Thumb and state
--neural-slider-thumb-sizeThumb width and height.
--neural-slider-thumb-backgroundThumb background surface.
--neural-slider-thumb-background-hoverHovered thumb background surface.
--neural-slider-thumb-background-invalidInvalid thumb background surface.
--neural-slider-thumb-borderThumb border shorthand.
--neural-slider-thumb-radiusThumb corner radius.
--neural-slider-thumb-shadowThumb box shadow.
--neural-slider-focus-ringComponent keyboard focus ring.
--neural-slider-focus-ring-offsetComponent focus ring offset.
--neural-slider-disabled-opacityDisabled opacity.
Value
--neural-slider-colorComponent foreground color.
--neural-slider-value-colorValue foreground color.
--neural-slider-value-font-sizeValue font size.