DatePicker

React DatePicker components are used to select a single date from a calendar. They are commonly used in forms, filters, booking flows, and scheduling features.

This DatePicker component is built with React Aria Components and styled using Tailwind CSS. It supports date selection with keyboard-friendly interaction.

Selected: Sunday, June 14, 2026

Installation

The Date Picker relies on @internationalized/date for date manipulation.

Install the component using the Tailgrids CLI.

npx @tailgrids/cli add date-picker

Usage

The following example demonstrates how to use the DatePicker compound components.

import {
  DatePicker,
  DatePickerGroup,
  DatePickerPopover,
  DatePickerTrigger
} from "@/registry/core/date-picker";
import { DateInput, DateSegment } from "@/registry/core/date-field";
import { CalendarDate, getLocalTimeZone, today } from "@internationalized/date";
import { useState } from "react";

export default function DatePickerUsage() {
  const [date, setDate] = useState<CalendarDate | null>(
    today(getLocalTimeZone())
  );

  return (
    <DatePicker value={date} onChange={setDate}>
      <DatePickerGroup>
        <DateInput>{segment => <DateSegment segment={segment} />}</DateInput>
        <DatePickerTrigger />
      </DatePickerGroup>
      <DatePickerPopover />
    </DatePicker>
  );
}

Examples

Basic Usage

A simple date picker with a label and helper description. The popover opens when clicking the calendar icon.

Appointment Date
Select your preferred appointment date.

Controlled

Manage the date value externally using value and onChange props.

Event Date

Uncontrolled

An uncontrolled DatePicker with a default value.

Event Date

Disabled

Use disabled prop to disable the DatePicker.

Appointment Date
This field is currently disabled.

With Date Constraints

Restrict date selection to a valid range using minValue and maxValue.

Appointment Date
Book within the next 3 months

With Date and Time

Combine date and time by using a CalendarDateTime value. Set granularity other then "day" to expose time segments.

Event Date & Time
Selected: None

Validation

A DatePicker with custom validation that rejects weekend selections using the validate prop.

Business Meeting

Service Booking

A DatePicker for selecting a service date, followed by a time slot picker that appears after a date is chosen.

Select Service Date

Availability Indicators

A DatePicker that uses isDateUnavailable to mark weekend dates as unavailable, with a legend inside the popover footer showing available and unavailable indicators.

Weekday Only

A DatePicker restricted to weekdays only using isWeekday from @internationalized/date. Useful for scheduling business appointments and professional meetings.

Business Day

Delivery Date Estimate

A DatePicker with a 3-day minimum notice period and shipping speed selection (Standard or Express) that estimates the arrival date.

Delivery Date

International Calendar

Wrap the DatePicker with an I18nProvider and set the locale prop to use a different calendar system.

Appointment Date

API Reference

DatePicker (Root)

The root component that wraps react-aria-components DatePicker. Accepts all AriaDatePickerProps with renamed boolean props.

PropTypeDefaultDescription
valueDateValue | nullThe currently selected date (controlled).
defaultValueDateValueThe initial default value (uncontrolled).
onChange(value: DateValue | null) => voidCallback when the value changes.
disabledbooleanfalseWhether the input is disabled.
readOnlybooleanfalseWhether the input is read-only.
requiredbooleanfalseWhether the input is required.
invalidbooleanfalseWhether the input is in an invalid state.
minValueDateValueThe minimum allowed date.
maxValueDateValueThe maximum allowed date.
classNamestringCustom class for the root wrapper.
namestringInput name for HTML form submission.
autoFocusbooleanWhether to auto-focus on render.
granularity"day" | "hour" | "minute" | "second""day"Smallest displayed unit.
hourCycle12 | 24Display time in 12 or 24 hour format.
hideTimeZonebooleanfalseWhether to hide the time zone abbreviation.
placeholderValueDateValue | nullPlaceholder date influencing display format when no value is selected.
firstDayOfWeek"sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat"The day that starts the week.
isDateUnavailable(date: DateValue) => booleanCallback to mark specific dates as unavailable.
isOpenbooleanWhether the popover is open (controlled).
defaultOpenbooleanWhether the popover is open by default (uncontrolled).
onOpenChange(isOpen: boolean) => voidHandler called when the popover open state changes.
shouldCloseOnSelectboolean | (() => boolean)trueWhether the popover closes automatically when a date is selected.
validate(value: DateValue) => string | true | undefinedValidation function. Return error message for invalid values.
validationBehavior"aria" | "native""native"Whether to use native HTML form validation or ARIA.

DatePickerGroup

A styled wrapper that groups the input and trigger button. Wraps react-aria-components Group.

PropTypeDefaultDescription
classNamestring | ((props: GroupRenderProps) => string)Custom class for the group element.
isDisabledbooleanWhether the group is disabled.
isInvalidbooleanWhether the group is invalid.
isReadOnlybooleanWhether the group is read only.
role"group" | "presentation" | "region""group"ARIA role for the group.
slotstring | nullSlot name to receive props from a parent component.
autoFocusbooleanWhether to auto-focus on render.
idstringThe element's unique identifier.
styleCSSProperties | ((props) => CSSProperties)Inline style for the element.
renderDOMRenderFunctionOverride the default DOM element with a custom render function.
childrenReactNode | ((props) => ReactNode)The children of the component.

DatePickerTrigger

Renders the calendar trigger button. Wraps react-aria-components Button.

PropTypeDefaultDescription
classNamestring | ((props: ButtonRenderProps) => string)Custom class for the trigger button.
isDisabledbooleanWhether the button is disabled.
isPendingbooleanWhether the button is in a pending state.
type"button" | "reset" | "submit""button"The behavior of the button when used in an HTML form.
autoFocusbooleanWhether to auto-focus on render.
excludeFromTabOrderbooleanWhether to exclude from sequential tab order.
preventFocusOnPressbooleanWhether to prevent focus from moving to the button when pressing.
slotstring | nullSlot name to receive props from a parent component.
formstringThe <form> element to associate the button with.
formActionstring | ((data: FormData) => void | Promise)URL that processes form submission.
formEncTypestringHow to encode form data that is submitted.
formMethodstringHTTP method used to submit the form.
formNoValidatebooleanWhether form validation is skipped on submission.
formTargetstringOverrides the target attribute of the button's form owner.
namestringSubmitted as a pair with the button's value as part of form data.
valuestringThe value associated with the button's name when submitted.
idstringThe element's unique identifier.
styleCSSProperties | ((props) => CSSProperties)Inline style for the element.
renderDOMRenderFunctionOverride the default DOM element with a custom render function.
childrenReactNode | ((props) => ReactNode)The children of the component.
onPress(e: PressEvent) => voidHandler called when the press is released over the target.
onPressStart(e: PressEvent) => voidHandler called when a press interaction starts.
onPressEnd(e: PressEvent) => voidHandler called when a press interaction ends.
onPressChange(isPressed: boolean) => voidHandler called when the press state changes.
onPressUp(e: PressEvent) => voidHandler called when a press is released over the target.
onFocus(e: FocusEvent) => voidHandler called when the element receives focus.
onBlur(e: FocusEvent) => voidHandler called when the element loses focus.
onFocusChange(isFocused: boolean) => voidHandler called when the element's focus status changes.
onKeyDown(e: KeyboardEvent) => voidHandler called when a key is pressed.
onKeyUp(e: KeyboardEvent) => voidHandler called when a key is released.
onHoverStart(e: HoverEvent) => voidHandler called when a hover interaction starts.
onHoverEnd(e: HoverEvent) => voidHandler called when a hover interaction ends.
onHoverChange(isHovering: boolean) => voidHandler called when the hover state changes.

DatePickerPopover

Renders the calendar popover. Wraps react-aria-components Popover.

PropTypeDefaultDescription
classNamestring | ((props: PopoverRenderProps) => string)Custom class for the popover element.
placementPlacement"bottom"The placement of the popover relative to its anchor element.
offsetnumber8Additional offset along the main axis between the popover and anchor.
crossOffsetnumber0Additional offset along the cross axis between the popover and anchor.
containerPaddingnumber12Padding between the popover and its surrounding container.
arrowBoundaryOffsetnumber0Minimum distance the arrow's edge from the edge of the overlay.
maxHeightnumberMaximum height of the popover. Defaults to available viewport height.
shouldFlipbooleantrueWhether to flip orientation when there is insufficient room.
shouldUpdatePositionbooleantrueWhether to update position automatically.
isKeyboardDismissDisabledbooleanfalseWhether pressing Escape to close is disabled.
isNonModalbooleanWhether elements outside the popover may be interacted with by assistive tech.
shouldCloseOnInteractOutside(element: Element) => booleanFilter interactions outside the popover that should not dismiss it.
isOpenbooleanWhether the overlay is open (controlled).
defaultOpenbooleanWhether the overlay is open by default (uncontrolled).
onOpenChange(isOpen: boolean) => voidHandler called when the overlay's open state changes.
isEnteringbooleanWhether the popover is performing an entry animation.
isExitingbooleanWhether the popover is performing an exit animation.
triggerRefRefObject<Element | null>Ref for the element the popover positions relative to.
scrollRefRefObject<Element | null>Ref for the scrollable region within the overlay.
arrowRefRefObject<Element | null>Ref for the popover arrow element.
boundaryElementElementdocument.bodyElement that serves as the positioning boundary.
triggerstringName of the component that triggered the popover (reflected as data-trigger attribute).
slotstring | nullSlot name to receive props from a parent component.
idstringThe element's unique identifier.
styleCSSProperties | ((props) => CSSProperties)Inline style for the element.
renderDOMRenderFunctionOverride the default DOM element with a custom render function.
childrenReactNode | ((props) => ReactNode)The children of the component.

Composition

The Date Picker is composed of the root DatePicker component plus DatePickerGroup, DatePickerTrigger, and DatePickerPopover. It can be combined with shared field components (FieldLabel, FieldDescription, FieldError) for a complete form control.

DatePicker                                                  — Root container. Manages date state, popover open state, and ARIA context.
├── FieldLabel                                              — Visible label.
├── DatePickerGroup                                         — Groups the date input and trigger button.
│   ├── DateInput                                           — Wraps editable segments in a styled input area.
│   │   └── DateSegment                                     — Individual editable segment (day, month, year).
│   └── DatePickerTrigger                                   — Calendar icon button that opens the popover.
└── DatePickerPopover                                       — Floating popover containing the calendar.
    └── Calendar                                            — The calendar grid for date selection.
        ├── CalendarHeader                                  — Month/year navigation row.
        │   ├── NavButton (previous)                        — Previous month button.
        │   ├── CalendarHeading                             — Current month/year label.
        │   └── NavButton (next)                            — Next month button.
        ├── CalendarGrid                                    — The week grid container.
        │   ├── CalendarGridHeader                          — Day-of-week header row.
        │   └── CalendarGridBody                            — Date cell rows.
        │       └── CalendarCell                            — Individual date cell.
  • Use DatePicker as the root. It provides the date value, validation state, and popover open state to all children.
  • Use FieldLabel to label the field. Pair it with aria-labelledby for accessibility.
  • Use DatePickerGroup to wrap the DateInput and DatePickerTrigger.
  • Use DateInput to render the segment group. It accepts a render function that receives each segment and returns a DateSegment.
  • Use DateSegment inside DateInput to render each editable part of the date. It handles focus, typing, and arrow-key incrementing.
  • Use DatePickerTrigger for the calendar icon button that opens the popover.
  • Use DatePickerPopover as the floating container for the calendar.
  • Use Calendar and its sub-components inside the popover to render the date selection grid.
  • Use FieldDescription for helper text. It is automatically announced by screen readers.
  • Use FieldError for validation messages. It is linked via aria-errormessage when invalid is set.

Accessibility

  • All buttons and calendar controls are keyboard accessible
  • Month navigation buttons support keyboard interaction
  • Uses standard <button> elements for all interactive controls
  • Focus is managed to allow closing the calendar without mouse input
  • Built on react-aria-components which follows WAI-ARIA authoring practices
  • Date segments are individually editable and accessible via keyboard
  • Validation errors are announced to screen readers via aria-describedby