Skip to content

Inputs

Slider

Also calledrange inputrange slider

A control with a movable handle for choosing a value within a range, such as volume or brightness.

How people describe it

  • “line with a knob I drag to change a value”
  • “volume control with a handle on a track”
  • “drag a dot between minimum and maximum”

Good for

  • Approximate volume or brightness settings
  • Choosing a value within fixed limits

Don’t mix it up with

  • Displays completion; it does not let the user adjust a value.

What your library calls it

LIBRARYCALLS IT
shadcn/uiSlider

Accessibility checklist

  • Label the range and communicate units
  • Preserve keyboard adjustment and visible focus
  • Provide precise entry when a slider alone is insufficient

Try it

40
0100

Drag it, or focus it and use the arrow keys.

Prompt

Add a labeled slider with keyboard adjustment and a visible current value.

~19 estimated prompt tokensDetailed: ~63 estimated prompt tokens

Rough estimate for prompt text only; actual counts vary by model and context.

<label for="volume">Volume</label>
<input id="volume" name="volume" type="range" min="0" max="100" step="1" value="50" aria-describedby="volume-unit" style="min-height:44px; width:100%; margin:0" oninput="document.getElementById('volume-value').textContent = this.value">
<output id="volume-value" for="volume">50</output>
<span id="volume-unit">percent</span>