Rug

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/slider-rug

About this component

A length slider for unrolling a rug across a wooden floor: the thumb is the roll itself, which turns as it goes and gets thinner the more rug it lays down, and the fill is the rug lying flat behind it, its woven diamonds and fringed end. Roll it back and the roll fattens again.

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

Triggers3

  • State change
  • Morph
  • Fill

Techniques4

  • Gradient
  • CSS variables
  • CSS transition
  • Pseudo elements

Accessibility

Keyboard and screen readers

A native range input named Rug unrolled with metres as its value text; the floor is aria-hidden.

Reduced motion

The roll resizes without easing.

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

More sliders

See all
SawGet code
ScalesGet code
SequinsGet code
SlacklineGet code