Skip to main content
InputLevel 1

Slider

滑块

WebMobileDesktopDifficulty: Medium

A track you drag left or right to land on a value, with the current number always shown beside it.

01

Live Demo

Actually clickable
42
Original 0100 max

Preview: filter strength 42%

Drag it, or use ← → (5 per step). The value must always be visible.

What you just saw:The brightness bar on a phone, the focus slider in a camera app, the "Filter intensity" control in a photo editor, the drag bars in the macOS trackpad settings.

02

What it actually is

A slider is for finding a value inside a continuous or stepped range — volume, brightness, filter intensity. It has one fatal weakness: the exact value is neither visible nor clickable, so you must always display the current number alongside it.

sliderrange sliderrange inputdrag barvalue sliderslider control
03

Anatomy · What it's made of

  1. Track轨道

    A thin 3px rounded line in gray

  2. Filled已选段

    The passed portion is tinted

  3. Thumb / Handle滑块

    An 18px circle that grows to 22px while dragging

  4. Value Label数值

    Shows the current value

  5. Bounds起止标注

    What each end means (Light / Full)

04

When to Use

When it fits, and when it doesn't
Slider usage recommendations
SituationUse it?
The value comes from a continuous range (0–100)Yes
The user is tuning to a feel rather than to an exact numberYes
The result can be previewed live while draggingYes
An exact number has to be enteredNo
The two ends of the range mean completely different thingsNo

When you need precisely 87%, a slider loses to a text field with stepper buttons.

Do not forget a numeric readout and full keyboard support, or the control is unusable for many people.

05

Similar Patterns

Don't mix these up
06

How to tell AI

Three levels of prompt

Add the component name and specifics

Add a filter intensity slider: 0–100, the value shown live on the right, a preview thumbnail above while dragging, and arrow keys adjusting by 5.

07

Don't just say this to AI

Bad → Better

Don't say this to AI

Add a bar you can drag.

Say this instead

Add a Slider (0–100): the value in a fixed-width column on the right (tabular-nums), a live preview while dragging that commits on release, ←/→ adjusting by 5, and Home/End jumping to the ends.

08

Share this card

Social-ready

Turn this pattern into a 3:4 or 1:1 knowledge card and export it as PNG right in the browser. No backend needed.