Skip to content

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

PropTypeDescription
open*boolean
error*boolean
onClose*() => void
startDate*Date
endDate*Date
onChangeStartDate*(newValue: DateValue) => void
onChangeEndDate*(newValue: DateValue) => void
onSubmit() => void
titlestring | 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.
classNamestring
labels{ start?: string | undefined; end?: string | undefined; cancel?: string | undefined; apply?: string | undefined; error?: string | undefined; }

Hooks

  • useDateRangePicker

Search documentation

Search pages, components and blocks.