Contour

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/slider-contour

About this component

An elevation slider drawn as a topographic map: the thumb is the summit and the filled part of the track is the hillside below it, ringed by wobbly contour lines with every fifth an index line, new ones drawing themselves in as you climb.

Dependencies
None
Difficulty
Advanced
Reduced motion
Respected
Theme
Light and dark
Follows page color-scheme

Triggers3

  • State change
  • Draw
  • Fill

Techniques4

  • SVG
  • stroke-dashoffset
  • clip-path
  • CSS variables

Accessibility

Keyboard and screen readers

A native range input named Elevation with metres as its value text; the map is aria-hidden.

Reduced motion

The rings appear without drawing in.

Use it in anything you build, commercial and client work included. Licence

More sliders

See all
CrosshatchGet code
CrystalGet code
CymaticsGet code
DiscoGet code