Slider

A slider users can drag — or set by voice: “volume to seventy”.

Speak the command followed by a number and the slider claims the phrase, parses the number — digits or words, “70” or “seventy” — and clamps it to the range. Dragging works exactly like a native range input, speech or no speech.

Basic slider

Loading the Angular kit…

Hold anywhere and say:“volume to seventy”“volume 25”“volume zero”

Props

  • default 0
  • default 100
  • default 1
  • default command
  • default false
Angular
Updates as you tick props
import { Component } from "@angular/core";import { ListensSliderComponent } from "@listenssoft/speechui-angular";
@Component({  selector: "demo-slider",  imports: [ListensSliderComponent],  template: `    <listens-slider label="Volume" command="volume" [(value)]="volume" />  `,})export class DemoSlider {  volume = 40;}

What you can say

SayEffect
“volume seventy”Sets the value to 70 (spoken numbers are parsed: words, digits, or both).
“volume to seventy”Same — filler words before the number are ignored.
“volume 3.5”Decimal digits parse too; the result is clamped to [min, max].
“volume three hundred”Clamped to max. Compound numbers (“two hundred fifty”) are understood.

The phrase must start with the command (a starts-with match claims the transcript so nothing else acts on it). The number is whatever parseSpokenNumber finds in the remainder; if there is no number, nothing happens.

API reference

Angular inputs & outputs for @listenssoft/speechui-angular.

Inputs

InputTypeDefaultDescription
minnumber0Lower bound; spoken values clamp to it.
maxnumber100Upper bound; spoken values clamp to it.
stepnumber1Drag increment of the range input. Spoken values are not snapped to step.
listeningContentstringcommandText shown as the label while the mic is open.
disabledbooleanfalseDisables the range input. Forms setDisabledState toggles it too.

Extra inputs

InputTypeDefaultDescription
valuenumber0Two-way bindable value — [(value)]. Also driven by ngModel / formControlName (the component is a ControlValueAccessor).
commandstringlabelThe spoken command; “<command> <number>” sets the value. Falls back to label.
labelstring""Label text above the slider; the command fallback.

Outputs

OutputTypeDefaultDescription
valueChangenumber—Emits on every value change (drag or speech) — the [(value)] two-way channel.
matchednumber—Emits when speech sets a value (the parsed, clamped number).

Styling hooks

CSS hooks

HookTypeDefaultDescription
.listens-slider (root)class—Same class convention as React: -label, -track, -input, -value parts. Styles are global (@layer listens); override with plain CSS.
--listens-interactivetoken—The fill/thumb color of the range input. Override on :root or any ancestor. See the theming guide.
data-listeningattribute—Present on the root while the mic is open — style the listening state directly.

Behavior notes

  • All frameworks: The value is set from speech only when the phrase starts with the command; a slider never reacts to a number spoken on its own.
  • Angular: Works with [(ngModel)] and reactive forms out of the box (ControlValueAccessor). See the forms guide.

Was this page helpful?