Skip to content

Date Picker

Form

Calendar-based date selection input with popover display.

Empty dateSelected dateDisabled
Open preview

Responsive viewport — resize the window to explore. Direction and density apply only to this preview. Theme applies to the docs too.

Usage

Use DatePicker for a single date in a compact popover. Store a Date or undefined. Use Calendar directly for multiple and range selection.

Import
import { DatePicker } from "@dashboardpack/core/components/ui/date-picker";

Available in the included @dashboardpack/core package. Copy the complete example from Source code for all imports and state. Add "use client" when using hooks or event handlers. See installation and theming for project setup.

API reference

Common props and defaults. Slot-specific props are named below; native elements also accept their standard HTML attributes. The component TypeScript definitions are the complete type reference.

Date Picker props
PropType / DefaultDescription
valueDate

Default: —

Selected date.
onChange(date: Date | undefined) => void

Default: required

Receives a selection or cleared value.
placeholderstring

Default: Pick a date

Trigger text when no date is selected.
disabledboolean

Default: false

Prevent opening the picker.

Build with these too