Modus UI

Rouse Track

Web (React)

A range input drawn as a field of bars that rise into a crest around the thumb.

Bars rest on the border token and fill with the primary ink up to the value, which is printed alongside. The crest follows the pointer and glides as you drag.

50
Modus / Rouse Track

Installation

CLI

npx @modus-ui/cli add rouse-track

Manual

  1. Copy the code from the component tab.
  2. Create a file at components/ui/rouse-track.tsx.
  3. Paste the code.

Usage

tsx
import { RouseTrack } from "@/components/ui/rouse-track";

export default function Example() {
  return <RouseTrack ariaLabel="Leading" />;
}

Props

PropTypeDefaultDescription
valueany--
defaultValuenumber50-
onChangeany--
minnumber0-
maxnumber100-
stepnumber1-
barsnumber48-
heightnumber56-
restHeightnumber12-
gapnumber4-
fillColorstring"hsl(var(--primary))"-
trackColorstring"hsl(var(--border))"-
crestColorstring""-
sensitivitynumber1-
reachnumber6-
skewnumber0.6-
glidenumber0.3-
smoothingnumber100-
showValuebooleantrue-
formatValueany--
disabledbooleanfalse-
ariaLabelstring"Value"-

Comments

  • No comments yet.