Prepared Docs

Prepared Docs

⌘K

    Loading navigation…

User

  1. Calendar
  2. Date Input
  3. API and Development

Date Input

API and Development

View Source
Submit Issue

DateInput from @prepared911/ui-calendar wraps an Input-style trigger that opens a DatePicker inside a Popover. It supports DatePickerMode.Single, Range, and DaysAgo, or a generic mode where you supply children and optional displayValue for bespoke triggers. Optional Apply/Reset flows (cta) work with onApply and onReset.

Props (discriminated by mode)

Shared across picker-backed modes:

NameTypeDescription
idstringRequired stable id for labels and inputs.
labelstringOptional field label.
placeholderstringInput placeholder.
disabledbooleanDisables the trigger and picker.
open / onOpenChangeboolean / handlerControlled popover open state.
showTooltipbooleanShow value tooltip on hover (default true).
hideMonthYearSelectbooleanHide month/year dropdowns in the embedded picker.
disableFuturebooleanPrevent selecting dates after today.
minSelectableDate / maxSelectableDateDateInclusive bounds.
ctabooleanShow Apply/Reset in the picker footer.
onApply(value: Date | { start: Date; end: Date }) => voidWhen cta is used.
onReset() => voidWhen cta is used.

mode: Single—value?: Date, onChange?: (Date) => void.

mode: Range—value?: { start: Date; end: Date }, matching onChange.

mode: DaysAgo—daysAgo: number plus single-date value / onChange for relative presets.

Generic—children, optional displayValue, optional tailIconButton; no embedded DatePicker mode enum on the generic branch.

Import

Single date

Previous

Date Input / Usage

Next

Date Input / Accessibility

On this page

Props (discriminated by mode)
Import
Single date