For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /dolan/slider.md.

Slider

Pick a number in a range, such as a volume or a brightness. Drag the thumb or tap the track, and give it variant="glass" for each platform's own slider.

Installation

npx @blotch/dolan add slider
import { UiSlider } from '../components/ui/slider';
Tip

This also adds Glass, which draws the glass variant's lens, and Icon, whose copy of the theme colors gives the iOS colors their dark mode.

Usage

src/app/app.ts
import { Component, signal } from '@angular/core';
import { LYNX_ELEMENTS } from '@blotch/angular-lynx';
import { UiSlider } from '../components/ui/slider';

@Component({
  selector: 'app-root',
  imports: [LYNX_ELEMENTS, UiSlider],
  template: `
    <text class="text-sm text-foreground">Volume {{ volume() }}</text>
    <ui-slider [(value)]="volume" accessibility-label="Volume" />
  `,
})
export class App {
  protected readonly volume = signal(40);
}
  • Drag the thumb to change the value. It keeps where your finger holds it, so it doesn't jump when you pick it up.
  • Tap the track to move the thumb there, or drag from beside the thumb to pull it under your finger.
  • A drag starts only once your finger moves sideways, so a scroll that starts on the slider scrolls the page and leaves the value alone. A sideways drag doesn't scroll the page.
  • A drag taps the phone at either end with LynxHaptics, and ticks on each step of a slider with 20 steps or fewer. A tap on the track gives none.
  • The slider fills the width it's given.

Range and steps

<ui-slider [min]="1" [max]="5" [(value)]="rating" />
<ui-slider [min]="0" [max]="1" [step]="0.05" [(value)]="opacity" />
  • The value goes from min to max (0 to 100 by default) in whole steps (1 by default).
  • A bound value outside the range or between steps shows at the nearest step. The slider only writes back values it sets itself.

Glass

Each platform's own slider:

<ui-slider
  variant="glass"
  [(value)]="brightness"
  accessibility-label="Brightness"
/>

On iOS 26 the thumb turns into a Liquid Glass lens while you drag it, magnifying the track under it, and turns solid again when you let go. It's the one place glass sits on content: Apple keeps glass for the layer above content, except on sliders and switches, and only while they're touched.

What each platform draws:

PlatformSlider
iOS 26 and lateriOS 26's slider: a 6pt track and a capsule thumb that turns to glass while it's held
iOS 15 to 25The classic slider: a 4pt track and a round white thumb
AndroidMaterial 3 Expressive's slider: a thick track with a bar handle in a gap, which narrows while it's held
Android, with provideGlass()iOS 26's slider, with Android's glass
Web previewiOS 26's slider, with the glass drawn by WebGL
  • iOS fills it with the system blue, UISlider's default tint. Its colors follow your app's color scheme, which provideIconTheme() sets.
  • Material uses the theme's colors: primary for the filled track, handle and stop dot, and secondary for the rest.

Disabled

<ui-slider [value]="30" disabled />

A disabled slider dims and ignores touches and screen reader actions.

Listen to changes

<ui-slider [(value)]="volume" (changed)="saveVolume($event)" />
  • valueChange (the [(value)] binding) follows every step of a drag.
  • changed emits the value you settled on: when a drag ends, after a tap, and after a screen reader action. Save or send the value here.

Forms

value is a model(), so the slider works with every Angular forms API:

<ui-slider [formControl]="volume" />
<ui-slider [(ngModel)]="volume" />
<ui-slider [formField]="settings.volume" />

UiSlider implements Signal Forms' FormValueControl<number>, including min, max and disabled. It emits touch when you finish changing it, so the field counts as touched. Reactive and template-driven forms bind to its value model directly, as Angular 22 does for any component with one. See Forms.

API

UiSlider

InputTypeDefaultDescription
valuenumber0The value. Supports [(value)].
minnumber0The value at the start of the track.
maxnumber100The value at the end of the track.
stepnumber1The values it stops at: min, min + step and so on.
disabledbooleanfalseDims the slider and ignores the user.
variant'default' | 'glass''default''glass' draws each platform's own slider.
accessibility-labelstring—What a screen reader calls it, such as 'Volume'.
valueText(value: number) => string—What a screen reader says for a value. A percentage without it.
classstring''Extra Tailwind classes for the slider.
OutputTypeDescription
valueChangenumberEmits each new value during a drag, for [(value)].
changednumberEmits the value the user settled on.
touchvoidEmits when the user finishes changing it, for forms.

Accessibility

  • A screen reader reads it as an adjustable element with its accessibility-label and its value, a percentage unless you pass valueText. Android's reads it as a slider.
  • Its Increase and Decrease actions move it by a tenth of the range, or one step when there are fewer than ten. VoiceOver lists them in its Actions rotor, and TalkBack in its actions menu.
  • Reduce Motion: the thumb jumps to a tapped value instead of gliding, and turns to glass and back without growing.
  • Reduce Transparency: iOS makes its own lens opaque. On Android and the web, the solid thumb grows instead of turning to glass.
VoiceOver's swipe up and down

VoiceOver adjusts an adjustable element with a swipe up or down, which calls the view's accessibilityIncrement. Lynx's iOS views don't implement it, so that swipe does nothing: choose Increase or Decrease from the Actions rotor instead.

  • Switch: on and off, whose thumb turns to glass too
  • Progress: a value the user doesn't set
  • Glass: the Liquid Glass the lens draws
  • Forms