Skip to main content
Neural UIv2.0.0Documentation
View v1 GitHub

Slider

Choose a number or an ordered interval with pointer and keyboard controls.

Category
Forms and selection
Import
@neural-ui/core/slider
Selector
neu-slider
import { NeuSliderComponent } from '@neural-ui/core/slider';

Usage

A numeric model creates one thumb; a readonly [number, number] model creates a range. There is no range input. minValue/maxValue define the scale and step defines increments. minStepsBetweenThumbs keeps a minimum separation. Use a number input instead when exact typed entry is important.

Examples

Interact with the example and open Code for its complete implementation.

Examples
20โ‚ฌ โ€“ 60โ‚ฌ

Try and configure

Change the controls and try the live preview. Expand the application value or event to inspect its real data; the generated template stays with the configurator.

Try and configure

Live preview

25%

Generated template: the options above. The Code tab contains the imports and state.

template.html
<neu-slider
  [(value)]="volume"
  [minValue]="0"
  [maxValue]="100"
  [step]="1"
  orientation="horizontal"
  [showTicks]="false"
  [showValue]="true"
  [label]="'Volume'"
  [unit]="'%'"
/>

Signal Forms

Bind FormField once to the component; the field owns value and validation. The required validator treats 0 as a value. This example also uses min(10), so a value below ten is invalid. Leave the control to mark it touched, then reset the field to clear both value and interaction state.

Signal Forms guide

Signal Forms
0%

Valid: false

Value and events

Use [(value)] or [value] with (valueChange), not both. The model synchronizes application state; other Outputs communicate their documented events. touch reports leaving/visiting the control, not a new value.

Accessibility and keyboard

Name the slider with label or ariaLabel and use unit to describe the value. A range exposes two separately focusable thumbs with minimum/maximum names. Arrow keys change one step, PageUp/PageDown ten steps, and Home/End uses the allowed bounds of the focused thumb.

Key
Action
Tab Focuses the thumb; a range has two tab stops.
Arrow keys Changes the focused thumb by one step.
PageUp / PageDown Changes it by ten steps.
Home / End Moves to the allowed minimum or maximum for that thumb.

API

Inputs, models and Outputs come from the pinned Core contract. Click named types to open their definitions. This component has no public template slots.

Inputs

Configure the component with [property]="value". Your application supplies these values; the component does not replace the state you pass in.

Name
Type
Default
Template binding
Description
ariaDescribedBystring''[ariaDescribedBy]IDs of elements describing the control, separated by spaces.
ariaLabelstring''[ariaLabel]Accessible name when no visible label is available.
dirtybooleanfalse[dirty]Form state indicating that the user has changed the value.
disabledbooleanfalse[disabled]Prevents user interaction.
errorsreadonly ValidationError.WithOptionalFieldTree[][][errors]Validation errors supplied by the form or the application.
hiddenbooleanfalse[hidden]Hides the control according to the form state.
inputIdstringinject(NeuIdGenerator).getId('neu-slider-')Derived default[inputId]Stable identifier of the native control; automatically generated when omitted.
invalidbooleanfalse[invalid]Displays the invalid state; it does not add a validation rule.
labelstring''[label]Visible label and accessible name of the control.
maxValuenumber100[maxValue]Upper endpoint of the slider scale.
minStepsBetweenThumbsnumber0[minStepsBetweenThumbs]Minimum gap between range thumbs, measured in multiples of step.
minValuenumber0[minValue]Lower endpoint of the slider scale.
namestring''[name]Name associated with the native form control.
orientation"horizontal" | "vertical"'horizontal'[orientation]horizontal or vertical track orientation.
pendingbooleanfalse[pending]Form state indicating that asynchronous validation is pending.
readonlybooleanfalse[readonly]Keeps the control focusable and readable without accepting edits.
requiredbooleanfalse[required]Marks the field as required; use a form validator to enforce it.
showTicksbooleanfalse[showTicks]Displays scale ticks.
showValuebooleantrue[showValue]Displays the current formatted value.
stepnumber1[step]Accepted increment between values.
touchedbooleanfalse[touched]Form state indicating that the control has been visited.
unitstring''[unit]Display suffix; the model remains numeric.

Models

A model supports [(property)]="signal" or the [property] and (propertyChange) pair. Choose one form, not both.

Name
Type
Default
Template binding
Description
valueV0 as VDerived default[(value)]Numeric value or readonly [number, number] interval. The model type determines the interaction.

Outputs

Listen to an event with (event)="handler($event)". The table explains the data your handler receives and how to use it.

Name
Payload
Template binding
Description
touchvoid(touch)="onTouch($event)"Notifies the form that the control has been touched; not a value change.

Templates

ng-content projects content into the component. TemplateRef inputs receive a template; ng-template directives identify templates with a typed context. A directive shared by an entrypoint is not necessarily a slot of this component.

This component does not expose content projection or public customization templates.

Public Types

Open a type to inspect its definition and interface fields.

Styles and tokens

Load Core styles once. Use the public tokens below for local customization or a preset for application-wide changes. Keep labels, focus, selected options and disabled states readable in both light and dark themes.

Specific tokens

This component uses shared theme tokens rather than dedicated component hooks.

Shared tokens used

Override these on a local wrapper to affect this example. An override on :root affects other components that use the same token.

Token
Purpose here
Other impact
Default / fallback
--neu-primary Brand color for active controls and emphasis Shared by other Core consumers; scope the override. #007aff
--neu-primary-dark Dark brand shade; outline and ghost Button text in the light theme Shared by other Core consumers; scope the override. #005fcc
--neu-surface Main field, header or control surface Shared by other Core consumers; scope the override. #ffffff
--neu-surface-3 Hover and raised control surfaces Shared by other Core consumers; scope the override. #e2e8f0
--neu-text-disabled Text of disabled controls Shared by other Core consumers; scope the override. #64748b
--neu-text-muted Secondary labels and supporting content Shared by other Core consumers; scope the override. #475569
--neu-font-sans Text typography Shared by other Core consumers; scope the override. 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif
--neu-primary-100 Inherited theme value used by this component Shared by other Core consumers; scope the override. #dbeafe