field.range

A value picked by sliding along a scale: volume, a playback position, a price limit. Give it min, max, value and an aria-label

Component

Renders

<input type="range">

Profile

Example

Preview
<Field intent="field.range" id="range" name="range" />

Choosing between neighbours

Find the row that describes your element, and use the intent on the right.

  • If it is

    Use

  • A value picked by sliding along a scale: volume, a playback position, a price limit. Give it min, max, value and an aria-label

    field.range this page
  • An exact amount someone types

    field.number

Connections

Declared in the registry, both directions. Where an intent is used in your own code is something check and the gallery see; this site has no app code.

For registry authors

Starter intents. These are the intents prongs add puts in your registry, shown in this site’s theme. Yours are your own registry.ts: rename, restyle and add to them, and see them with prongs add gallery.

What this intent is built from and its entry in components/prongs/registry.ts. You only need this to change how it looks or to add an intent like it.

How field.range resolves, and its definition

Each layer adds to the one before it; a later class wins over an earlier one that sets the same thing.

  • input.range

    A slider along a track

    h-4 w-full min-w-0 cursor-pointer accent-primary
  • field.range

    A value picked by sliding along a scale: volume, a playback position, a price limit. Give it min, max, value and an aria-label

Final classes
h-4 w-full min-w-0 cursor-pointer accent-primary
Element behaviour
{ type: 'range' }
Definition
TS
'field.range': {
kind: 'semantic',
description: 'A value picked by sliding along a scale: volume, a playback position, a price limit. Give it min, max, value and an aria-label',
refs: ['input.range'],
binding: { behavior: { type: 'range' } },
notFor: [{ context: 'an exact amount someone types', instead: 'field.number' }],
},