A range picker for dashboards: the range and its length rolling in the trigger, grouped presets on a rail, a range grid whose fill ripples from the start, typed FROM and TO dates, and APPLY.
pnpm dlx shadcn@latest add @beautiful-ui-pro/date-range-pickerNeeds your registry key. Your components.json style picks the Base UI or Radix build: radix-*, new-york and default get Radix, base-* gets Base UI.
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 { DateRangePicker, type DateRangeValue, type RangePresetGroup } from "@/components/ui/notchset/date-range-picker";
const DAY = 864e5;
const today = new Date(new Date().setHours(0, 0, 0, 0));
const yesterday = new Date(today.getTime() - DAY);
const presets: RangePresetGroup[] = [
{
group: "RECENT",
items: [
{ label: "Last 7 days", from: new Date(today.getTime() - 7 * DAY), to: yesterday },
{ label: "Last 30 days", from: new Date(today.getTime() - 30 * DAY), to: yesterday },
],
},
];
export function ReportRange() {
const [range, setRange] = React.useState<DateRangeValue>({ from: presets[0]!.items[0]!.from, to: yesterday });
return <DateRangePicker value={range} onValueChange={setRange} presets={presets} max={yesterday} />;
}value / onValueChange–
{ from: Date, to: Date }Changes only on APPLY or a preset.
presets–
{ group, items: { label, meta?, from, to }[] }[]The rail.
min / max–
DateThe pickable span.
customLabel–
stringThe rail's last row (clears and focuses FROM).
events–
Record<YYYY-MM-DD, string[]>Dots under days.
components/ui/notchset/date-range-picker.tsx
This component is included with Pro.
Try the live preview above. Get Pro to install the source.