Primitives
Date range picker
Start and End slots, presets with their dates, a band that previews the span, Apply or apply on select.
Presets show their dates; nothing changes until Apply.
One month, no presets, applies on the second click.
date-range.tsx
"use client";
import { DateRangePicker, type DateRangeValue, Label } from "@waveinno/ui";
import * as React from "react";
export default function RangeDemo() {
const [range, setRange] = React.useState<DateRangeValue>({ from: "2026-09-24", to: "2026-09-30" });
const [stay, setStay] = React.useState<DateRangeValue>({ from: "", to: "" });
return (
<div className="grid gap-6 md:grid-cols-2">
<div className="space-y-1.5">
<Label>Report period</Label>
<DateRangePicker value={range} onChange={setRange} />
<p className="text-[12px] text-muted">Presets show their dates; nothing changes until Apply.</p>
</div>
<div className="space-y-1.5">
<Label>Reserve a space</Label>
<DateRangePicker value={stay} onChange={setStay} numberOfMonths={1} presets={[]} applyOnSelect placeholder="Arrival → departure" />
<p className="text-[12px] text-muted">One month, no presets, applies on the second click.</p>
</div>
</div>
);
}Import#
Everything comes from the package root. The example above uses:
your-component.tsx
import { DateRangePicker, type DateRangeValue, Label } from "@waveinno/ui";Props#
Read from the source of this version, so they match the code exactly.
<DateRangePicker>
src/components/ui/date-picker.tsx| Prop | Type | Default | Description |
|---|---|---|---|
id | string | — | |
placeholder | string | "Pick a date range" | |
disabled | boolean | — | |
clearable | boolean | true | |
className | string | — | |
locale | string | "en-GB" | Month and weekday names and digits, e.g. "bn-BD". |
weekStartsOn | Weekday | 1 | 0 = Sunday … 6 = Saturday. |
valuerequired | DateRangeValue | — | |
onChangerequired | (value: DateRangeValue) => void | — | |
min | string | — | |
max | string | — | |
presets | DateRangePreset[] | DEFAULT_RANGE_PRESETS | Quick ranges on the left; [] hides the list. |
numberOfMonths | 1 | 2 | 2 | |
applyOnSelect | boolean | false | Commit when the last day is picked, with no Apply button. |
labels | { clear?: string; pickEnd?: string; start?: string; end?: string; apply?: string; cancel?: string; days?: (n: number) => string } | — |
<Label>
src/components/ui/label.tsx| Prop | Type | Default | Description |
|---|---|---|---|
required | boolean | — |
Also takes ComponentPropsWithoutRef<typeof LabelPrimitive.Root>.
Install#
If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.
$ npm install @waveinno/ui