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.

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
PropTypeDefaultDescription
idstring—
placeholderstring"Pick a date range"
disabledboolean—
clearablebooleantrue
classNamestring—
localestring"en-GB"Month and weekday names and digits, e.g. "bn-BD".
weekStartsOnWeekday10 = Sunday … 6 = Saturday.
valuerequiredDateRangeValue—
onChangerequired(value: DateRangeValue) => void—
minstring—
maxstring—
presetsDateRangePreset[]DEFAULT_RANGE_PRESETSQuick ranges on the left; [] hides the list.
numberOfMonths1 | 22
applyOnSelectbooleanfalseCommit 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
PropTypeDefaultDescription
requiredboolean—

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