Date Picker

A React date picker in a Base UI popover for single dates, ranges, and multiple dates, with presets, time selection, and min and max dates.

Loading preview

Examples

Practical examples and common states for the same installable component.

Range

Select a continuous start and end date.

examples/date-picker-range.tsx
"use client";
import * as React from "react";
import { DatePicker } from "@/components/wensity/date-picker";
export function RangeDatePicker() {
const [range, setRange] = React.useState<{ from?: Date; to?: Date }>();
return (
<DatePicker
mode="range"
value={range}
onChange={setRange}
placeholder="Select date range"
/>
);
}

Multiple

Select multiple independent dates.

examples/date-picker-multiple.tsx
"use client";
import * as React from "react";
import { DatePicker } from "@/components/wensity/date-picker";
export function MultipleDatePicker() {
const [dates, setDates] = React.useState<Date[]>([]);
return (
<DatePicker
mode="multiple"
value={dates}
onChange={setDates}
placeholder="Pick dates"
/>
);
}

Presets

Quick-select from predefined date shortcuts.

examples/date-picker-presets.tsx
"use client";
import * as React from "react";
import { DatePicker } from "@/components/wensity/date-picker";
export function PresetDatePicker() {
const [date, setDate] = React.useState<Date>();
return (
<DatePicker
value={date}
onChange={setDate}
presets={[
{ label: "Today", getValue: () => new Date() },
{ label: "Tomorrow", getValue: () => { const d = new Date(); d.setDate(d.getDate() + 1); return d; } },
]}
/>
);
}

Date & Time

Select both a date and a specific time.

examples/date-picker-date-time.tsx
"use client";
import * as React from "react";
import { DatePicker } from "@/components/wensity/date-picker";
export function DateTimePicker() {
const [date, setDate] = React.useState<Date>();
return (
<DatePicker
value={date}
onChange={setDate}
placeholder="Pick date & time"
dateTime
/>
);
}

Month & Year

Quickly navigate months and years via header pickers.

examples/date-picker-month-year.tsx
"use client";
import * as React from "react";
import { DatePicker } from "@/components/wensity/date-picker";
export function MonthYearPicker() {
const [date, setDate] = React.useState<Date>();
return (
<DatePicker
value={date}
onChange={setDate}
monthYear
presets={false}
/>
);
}

Overview

Date Picker is a React and Tailwind CSS date picker, in Next.js or any React app, that opens the Calendar primitive in a Base UI popover from a button showing the chosen date. It handles a single date, a range, or several dates, with presets such as Today, Last 7 days, and This month that you can replace. dateTime adds hour and minute selects to a single date, fromDate and toDate block days outside a window, and a clear button resets the value. Dates are formatted in English, such as Mar 4, 2026.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add date-picker

Usage

Import DatePicker from @/components/wensity/date-picker and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
import * as React from "react";
import { DatePicker } from "@/components/wensity/date-picker";
export function DatePickerDemo() {
const [date, setDate] = React.useState<Date | undefined>();
return (
<DatePicker
value={date}
onChange={setDate}
placeholder="Pick a date"
/>
);
}

Props

PropTypeDefaultDescription
mode"single" | "range" | "multiple""single"Selection model. Changes the shape of value and onChange.
valueDate | Date[] | DateRange-Controlled value. Type follows mode.
defaultValueDate | Date[] | DateRange-Initial value when uncontrolled.
onChange(value: Date | Date[] | DateRange | undefined) => void-Called when the selection changes. Argument follows mode.
placeholderstring-Trigger text while nothing is selected.
dateDisabled(date: Date) => boolean-Return true to block a date from selection.
fromDateDate-Earliest selectable date.
toDateDate-Latest selectable date.
weekStartsOn0 | 10First day of the week. 0 is Sunday, 1 is Monday.
presetsboolean | DatePreset[]trueQuick-selection buttons. Pass an array to customise them.
dateTimeboolean-Adds an hour and minute picker beside the calendar.
monthYearbooleantrueEnables the month and year quick-nav pickers.
disabledboolean-Disables the trigger.
  • GitHub-Style Activity Grid component preview

    GitHub-Style Activity Grid

    365 squares sharing one tooltip that flies between days on rails, with a reveal that ripples backward from today.

  • Split-Flap Display component preview

    Split-Flap Display

    A ceramic and graphite split-flap device that ripples each flap into your message.

  • Gooey Dropdown Menu component preview

    Gooey Dropdown Menu

    A capsule trigger drips a menu out of its underside. Arrow keys, live shortcuts, and a clear Delete row come built in.

  • Multi-Step Form Wizard component preview

    Multi-Step Form Wizard

    A multi-step form wizard whose card physically reshapes to wrap each new step as the content slides in behind it.