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. Usage

Date Input

Usage

Overview
DateInput from @prepared911/ui/date-input is a read-only formatted date beside a calendar button. The popover hosts a single-mode Calendar with Reset and Apply so operators pick a day on the grid. Use it in filter bars and forms where the calendar stays hidden until requested (ui-calendar parity). For a committed start-end span use DateRangeInput. For Before, After, or Between limits use DateRangeInput with modes.
Reset zoom to 100%
When to use
  • Filter bars and dense forms. Scheduling and archive filters use DateInput because the calendar should stay hidden until requested.
  • Committed picks with review. Reset and Apply are always shown; day presses update a draft until Apply commits.
When not to use
  • Always-visible calendars. If the grid should stay open alongside the form (scheduling panels, side-by-side comparisons), use Calendar inline instead.
  • Inequality semantics. Use AdvancedDateRangePicker for Before / After / Between.
  • Repeating rules. Use RecurrenceField.
Composition
  • Trigger. Read-only formatted value in a Field-style frame; optional clear control.
  • Popover. Opens from the calendar button (or keyboard on the trigger); Reset and Apply sit under the calendar.
  • Calendar body. Single-mode Calendar bound to the shared draft while the popover is open.
Behavior and states
  • Deferred commits. applyLabel and resetLabel are required. Day presses update a draft; onValueChange runs on Apply. Reset restores the draft held when the popover opened. Escape and an outside press close without committing. While the popover is open the trigger shows the committed formatted value and the hidden input keeps the committed ISO date.
  • Clear. The clear button is on by default while a date is set. Pass clearable={false} to hide it. Clear, from the field or the panel, commits an empty value at once, closes the popover and focuses the field; Escape or a press outside does not bring the old date back. Reset restores the original value.
  • readOnly. The formatted value stays focusable and copyable; the calendar and clear controls are hidden and the popover does not open.
  • Open state. Control via open / onOpenChange when a parent overlay (Drawer, Dialog) coordinates focus.
Best practices
Do
  • Always pass applyLabel, resetLabel, and clearLabel (unless clearable={false}).
  • Always pass label: it names the read-only input for assistive technology.
  • Coordinate onOpenChange with parent overlays (Dialog, Drawer) to manage focus return correctly.
Don't
  • Don't nest DateInput inside another focus-stealing overlay without verifying focus returns to the field on close.
  • Don't use DateInput when the calendar should always be visible; Calendar inline is clearer in that case.
Accessibility
DateInput is a read-only textbox, popover, and calendar. The mode select on other pickers is a separate combobox; DateInput has no mode select. See the Accessibility page for the full contract.
Related
  • Date Picker: the underlying grid; use inline when the calendar should always show.
  • Date Time Picker: add time-of-day to the selection.
  • Advanced Date Range Picker: Before / After / Between semantics.
Previous
Virtualized List / Accessibility
Next
Date Input / API and Development
On this page
Overview
When to use
When not to use
Composition
Behavior and states
Best practices
Accessibility
Related