Skip to the page
Tactile UI

Range

A rule variant puts one value on an engraved scale in a recessed channel, read by a slide rule’s carriage: a glass window with one hairline and the number on the glass, the scale under it magnified a little about the hairline, and one line under the rule saying what the value means. For model settings and budgets, as in the second panel below. The original is two fader caps in one slot, for a span between a low value and a high one: a price band, quiet hours, a frequency band. The span between the caps is printed on the slot’s floor and both values read on a small LCD. The caps meet but never pass each other. Underneath are two native range inputs, which post with the form and are what shows without the script.

On this page
  1. Anatomy
  2. Variants
  3. States
  4. Props and options
  5. Usage notes
  6. Accessibility
  7. Related parts

Anatomy

Pointer capture keeps a drag on its cap when the pointer leaves the slot, and a press on the slot brings whichever cap is nearer. The one touched last sits on top, so two caps that meet can both still be caught.

Variants

  • Quiet hours · a unit after
  • Held apart · gap
  • Rule · no script: one fader
  • No script: two faders

States

  • Rest
  • Hover
  • Held
  • Focus

Props and options

NameKindDescription
unit-labelattributeThe unit as the label row says it, muted straight after the label (“Monthly spend limit USD”). Left out when the label already names it (“Max output tokens”).
tick-stepattributeA tick at every multiple of this inside min and max, and one at each end; every fifth is taller and labelled where the width allows. What is printed thins by the rule’s own width, never by the page’s: every other minor tick, then only the labelled ones, with the value still stepping by this number.
unit · unit-placeattributeThe unit printed and spoken with each value.
labelsattributeTwo comma separated names for the caps, used when a native input has no label span or aria-label of its own. Default “Lowest” and “Highest”.
gapattributeThe least the two values may be apart. The caps stop that far from each other.
min · max · step · valueattributeThe scale, read from the first input. Both inputs share it.
input · changeeventAs ever, on the native input whose cap moved: input while it moves, change when it is let go or a key is pressed.
Arrows · Page Up · Page Down · Home · EndkeyboardA step, a tenth of the scale, and as far as the cap can go: the end of the scale, or the other cap.
rangeSnap · rangeSet · rangeKey · rangeText · rangeHTMLfunctionThe rules, pure: a value on the scale, a cap that cannot cross, what a key does, a value with its unit, and the built markup.

Usage notes

Drag either cap, or press the slot to bring the nearer cap there. Tab to a cap and use the arrows for a step, Page Up and Page Down for a tenth, Home and End for as far as it can go. The caps stop at each other.

Accessibility

  • The LCD readout repeats what the caps already say and is hidden from assistive technology.
  • Without the script the two native ranges are there, labelled and in a fieldset, and post the same values.
  • The slot lets the page scroll up and down under a thumb and takes only sideways drags.
  • The caps do not animate, so reduced motion changes nothing for them: they go where they are sent.
  • It is written when the value stops changing, about a third of a second after the last move, so a drag is not read pixel by pixel.
  • The value is read on the carriage’s glass and never anywhere else.
  • Ticks, labels, the LCD and the meaning line are hidden from assistive technology; the slider already says all of it.

Fader

A continuous value along a line: a native range whose cap rides in a slot cut into the plate, with a printed scale.

Scrub field

A number you can type or drag, the way a pro tool’s value field works: an engraved ruler under the numerals slides beneath a fixed index as the value moves.

Knob

A rotary control for continuous or stepped values where space is square. Its knurl and pointer turn; its light does not.