Day to YTD, with the period's average and its change in words.
Every shadcn style · one file
v2.0 · Updated Oct 13pnpm dlx shadcn@latest add https://notchset.dev/r/range-control.jsonpnpm dlx shadcn@latest add https://notchset.dev/r/range-control.jsonFree, no account or key. One command for every shadcn style. With the @notchset registry added, @notchset/<name> works too.
Works with React 18.3 or 19 on Tailwind CSS v4, in any shadcn project. What's tested
The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
Import it and pass your content. The props that matter most are listed next.
"use client";
import * as React from "react";
import { RangeControl, type RangePeriod } from "@/components/ui/notchset/range-control";
const FIG: Record<RangePeriod, [string, string, string]> = {
day: ["6 h 57", "last night", "Through the night"],
week: ["6 h 51", "this week", "+9 min against last week"],
month: ["6 h 48", "this month", "+4 min against last month"],
"6m": ["6 h 44", "the last 6 months", "−2 min against the 6 months before"],
year: ["6 h 46", "this year", "Same as the year before"],
ytd: ["6 h 47", "the year to date", "+1 min against last year to date"],
};
export default function RangeControlDemo() {
const [p, setP] = React.useState<RangePeriod>("week");
const [figure, words, delta] = FIG[p];
return (
<div className="max-w-[720px]">
<RangeControl value={p} onValueChange={setP} figure={figure} words={words} delta={delta} tone={delta.startsWith("+") ? "ok" : "neutral"} />
</div>
);
}components/ui/notchset/range-control.tsx
value–
RangePeriodRequired.
onValueChange–
(p: RangePeriod) => voidRequired.
options["day", "week", "month", "6m", "year", "ytd"]
RangePeriod[]the periods this metric can show, in order
figure–
stringthe period's figure, "6 h 51"
unit–
stringits unit, small beside it
lead"Avg"
stringthe label before it, "Avg"
words–
string"this week"
delta–
string"+9 min against last week", or why there's none
tone"neutral"
"ok" | "bad" | "neutral"which way the delta reads: ok (better), bad (worse) or neutral
label"Time range"
stringnames the switch for a screen reader
Give your coding assistant the Markdown guide instead of screenshots.
https://notchset.dev/api/mcp (setup)v2.0.0 · 2026-10-13
Released with the Notchset system.
The same file, at work in a finished app. Open it live and find it on its pages.
Wearables and trends. Connect a device, trust what it reports, and read any metric from Day to YTD with what drove it.
4 free · 4 ProSee the Wearables and trends kit