Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Calendar
  2. Date Input
  3. API and Development

Date Input

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
DateInput from @prepared911/ui/date-input wraps an Input-style trigger that opens a Calendar inside a Popover. It supports CalendarMode.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.
labelLocalizedMessageOptional field label. Pass formatMessage output.
placeholderLocalizedMessageInput placeholder. Pass formatMessage output.
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 Calendar 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