Forms/DatePicker

DatePicker

A text input that opens a popover calendar on click. Closes on select, outside click, or Escape.

import { DatePicker } from "@animui/ui"

Basic

Custom format

Use formatDate to control how the selected date is displayed.

Disabled

Props

PropTypeDefaultDescription
valueDateCurrently selected date (controlled).
onChange(date: Date) => voidCalled when a date is selected in the calendar.
placeholderstring"Select date"Text shown in the trigger when no date is selected.
formatDate(date: Date) => stringtoLocaleDateString()Custom formatter for the selected date label.
disabledbooleanfalsePrevents opening the popover.
classNamestringAdditional classes for the wrapper element.

Accessibility

  • Trigger exposes aria-haspopup and aria-expanded.
  • Pressing Escape or clicking outside closes the calendar.
  • The embedded Calendar supports full keyboard navigation with arrow keys.
© 2026 Steal Shadow. MIT License.Report an issue