bloxa

Date Picker

FREE

Date and date-range picker built on Calendar and Popover, localized with Intl.

Playground

Change the props and watch the component and its code update live.

Props
Code
import { DatePicker } from "@/components/ui/date-picker";

<DatePicker
  locale="tr-TR"
  clearable
  formatOptions={{ dateStyle: "medium" }}
/>

Installation

Terminal
npx @bloxa/cli add date-picker
# or: npx shadcn@latest add @bloxa/date-picker

Examples

Single date

Date range

Constraints

No past dates, no weekends, up to two months ahead.

API reference

Every component also accepts the props of the element it renders.

DatePicker

PropTypeDefaultDescription
mode"single" | "range""single"Single date or range.
value / defaultValueDate | { from?, to? }—Selected date(s).
onValueChange(value) => void—Called when the selection changes.
formatOptionsIntl.DateTimeFormatOptions—Date format on the trigger.
clearablebooleanfalseClear button.
locale / weekStartsOn / minDate / maxDate / isDateDisabled——Same as Calendar.
numberOfMonths1 | 22Months side by side in range mode.
size"sm" | "md" | "lg""md"Height and text size.