Skip to content
Glint UI

RangeSlider

Several stops on one track, each bounded by its neighbours.

Usage

import { RangeSlider } from "@glint/components/range-slider.slint";
export component AppWindow inherits Window {
in-out property <[float]> bounds: [10, 90];
VerticalLayout {
alignment: center;
RangeSlider {
minimum: 0;
maximum: 100;
step: 1;
values <=> root.bounds;
changed(thumb-index, new-val) => {
// handle range adjustment
}
}
}
}

RangeSlider allows users to select intervals or sub-ranges across two or more movable thumbs. Thumbs are clamped against their neighboring stops so they can meet but never cross.

Examples

Multi-stop values

values accepts two or more numbers. Providing three or more values creates a multi-stop slider with that number of draggable thumbs.

Custom labels and stepping

Use labels to supply descriptive accessible names for each thumb in order, and step to define snapping increments.

Disabled state

Setting disabled: true dims the slider and disables drag, click, and keyboard interactions.

API Reference

Properties

PropertyTypeDefaultDescription
valuesin-out [float][0, 100]Two-way; the stops, in ascending order. Two of them is the interval control; three or more is a multi-stop slider.
minimumin float0Lower bound of the whole range (inclusive).
maximumin float100Upper bound of the whole range (inclusive).
stepin float1The grid every user-driven value lands on, counted from minimum — same contract as Slider.step, pointer and keyboard alike. 0 turns snapping off.
disabledin boolfalseWhen true, every thumb dims and stops responding.
labelsin [string][]Accessible names for the thumbs, in values order. A multi-stop control is that many slider nodes, and the call site cannot reach inside to name them the way it names a Slider, so the names come in as a list — ["Minimum price", "Maximum price"]. The group itself takes the call site's own accessible-label:.
value-labelin string@tr("Value")What a thumb this list does not name is called, with its position appended: "Value 1", "Value 2". A name nobody chose is still better than an unnamed control, which is one assistive technology cannot ask for.

Callbacks

CallbackDescription
changed(int, float)Fired with the thumb that moved and its new value. Read values for the whole set.

Accessibility

  • Multiple slider nodes. Each thumb is an independent slider accessible node reporting its individual value and the dynamic bounds imposed by its neighboring thumbs.
  • Accessible names. Thumb names are derived from the labels array or formatted via value-label.
  • Keyboard controls. Tab focuses each thumb sequentially. / decreases value, / increases value, and Home/End jumps to the nearest boundary.