Angular playground

Nova v3.37.0

Preview

Angular

Slider

nv-fieldslider

A form field for choosing a number or a range by dragging along a track.

Live demo

Use a slider when people choose a value from a continuous range and an approximate position is enough, such as a power limit or a price range. Set range to choose a start and an end. For an exact number, use a number field, or add a number input with hasField.

Anatomy

A slider with seven callouts: 1 the label Midi-chlorian counts, 2 the description, 3 the error description, 4 the track, 5 the round thumb, 6 the tick marks below the track, and 7 a number field showing 500 W.

The parts of a slider, shown in its error state.
  1. Label names the value; hideLabel hides it visually only.
  2. Description (optional) adds context.
  3. Error description explains an invalid value.
  4. Track spans min to max.
  5. Thumb shows and sets the value; a range has two. Arrow, Page, Home and End keys move it.
  6. Ticks (optional) mark steps with showTicks, or custom values with labels through ticks.
  7. Number field (optional, hasField) shows the value and accepts typing, with a unit from labelBeforeValue or labelAfterValue.

Values and states

The value is always an array: one number, or two for a range. step and snap control how values move. Disabled sliders cannot be used, and read-only ones remain focusable but keep their value unchanged. Set error with an errorDescription, or success after validation. Pair the colour change with text so the result is understandable without colour alone.

Use labelBeforeValue or labelAfterValue for context such as a currency or unit. fluid removes the default 480 px width limit. hideLabel hides the label visually; keep a meaningful label available to assistive technology.

showTicks
hasField
disabled

Guidelines

  • Add a clear label and a unit.
  • Use steps and ticks that suit the data.
  • Pair a number field with the slider when people need an exact value, and configure step and snap for the required precision.
  • Keep validation messages and units visible; colour alone is insufficient.
DoName the value, show its unit and mark useful steps.
Don'tAvoid a slider without a visible label or unit.

Sources