Custom Date Range Picker
Date range input with a calendar popover and range presets.
Installation
bun add @xerobi/ui
import { CustomDateRangePicker } from "@xerobi/ui/custom-date-range-picker"This component is client-side. In Astro, hydrate it with a client directive.
API reference
CustomDateRangePicker
| Prop | Type | Description |
|---|---|---|
| open* | boolean | |
| error* | boolean | |
| onClose* | () => void | |
| startDate* | Date | |
| endDate* | Date | |
| onChangeStartDate* | (newValue: DateValue) => void | |
| onChangeEndDate* | (newValue: DateValue) => void | |
| onSubmit | () => void | |
| title | string | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode> | |
| variant | "input" | "calendar" | `input` shows two date fields, `calendar` shows two calendars side by side. |
| className | string | |
| labels | { start?: string | undefined; end?: string | undefined; cancel?: string | undefined; apply?: string | undefined; error?: string | undefined; } |
Hooks
useDateRangePicker