Input Date

new

For birthdays, deadlines and other dates you'd rather not think about.

Demo
6
21
1990

Selected: 1990-06-21

Open Props in the corner of the example to try variant, size, disabled, readonly and loading. disabled fades the frame and the segments; readonly keeps the date focusable but not editable.

The five text control variants, the same as on Input.

The field runs from 28px at xs to 48px at xl, the heights of the matching inputs.

Installation

Usage

<script setup lang="ts">
import { CalendarDate } from '@internationalized/date'
import type { DateValue } from 'reka-ui'
import { InputDate } from '@/components/ui/input-date'

const date = shallowRef<DateValue | undefined>(new CalendarDate(2025, 3, 14))
</script>

<template>
  <InputDate v-model="date" />
</template>

Day, month and year are separate segments, in the order the locale writes them. Type digits or use the arrow keys; once a segment is full, focus jumps to the next one. Paste an ISO date such as 2025-03-14 to fill them all at once.

v-model is a CalendarDate from @internationalized/date, or undefined until every segment is filled. toString() gives the ISO date, and parseDate() reads one back.

Set name, and it submits as YYYY-MM-DD. Give it an aria-label, or put it in a Field.

Examples

Range

InputDateRange puts a start and an end date in one frame. Its v-model is { start, end }. An end before the start marks both ends invalid.

With name, the form gets two fields, name[start] and name[end], each an ISO date and empty until that end is filled. required needs both.

Range
7
4
2025
7
18
2025

14 nights.

Date and time

Pass a CalendarDateTime and set granularity to hour, minute or second, and the time segments follow the date in the same field. hour-cycle picks 24 or 12; 12 adds the AM/PM segment.

With time
9
12
2025
9
12
2025

Min and max

A date before min-value or after max-value marks the segments aria-invalid, which turns the frame destructive. Put invalid on the field to show the error.

The model updates while the year is typed, so 2025 passes through 0002 and 0020 on the way. Check the date on submit, or after the field loses focus, not on every keystroke.

Min and max
2
19
2027
Bookings open 90 days ahead.

Unavailable dates

is-date-unavailable rules out single dates: weekends, holidays, sold-out days. An unavailable date is invalid, the same as one outside min and max.

Unavailable dates
11
22
2025
We don't deliver at weekends.

Locale

There is no format prop. The segment order and the separators come from locale, or from Reka UI's ConfigProvider when it's not set.

Locale
3
14
2025
14
3
2025
2025
3
14

Loading

loading puts a spinner at the end of the field and marks it aria-busy. Typing stays on.

Loading
12
31
2025

Checking whether the hall is free…

In an input group

Inside an InputGroup the field drops its own frame and takes the group's variant and size, so icons, text and buttons share one frame with it. Clicking an addon focuses the first segment.

In a group
mm
dd
yyyy

Form

Bind v-model, name and the focus and blur events rather than spreading a form library's whole field object: placeholder here is a date, not hint text, so a string placeholder from the library would break it. focus and blur fire once per field, not once per segment, so validate-on-blur works.

The field's element is a group, not an input. Register its first segment with the form library so it can focus the field after a failed submit.

A value set from outside the field, by a Today button or a calendar, fires neither event. If your form validates on blur only, validate on input too.

Form
mm
dd
yyyy
mm
dd
yyyy
mm
dd
yyyy

We check it at the front desk.

Known limits

These come from Reka UI's DateField, which is still alpha upstream.

  • Typing into the last segment never stops: a fifth year digit starts the year over (reka-ui#2002).
  • Backspace in an empty segment doesn't move back to the previous one (reka-ui#1758).
  • Copy and select-all are blocked in the segments; paste works (reka-ui#1897).
  • A form reset, or clearing v-model, doesn't empty a half-typed field: the value was already undefined, so nothing changes (reka-ui#1939). Reset the field by remounting it with a new key.
  • No month-and-year field, for card expiry dates and the like (reka-ui#2099).
  • InputDateRange has no step-snapping (reka-ui#2789).
  • The segments' screen reader labels ("day", "month", "year") are English only.
  • With a non-Gregorian locale such as fa-IR or th-TH, InputDate's hidden input writes that calendar's year, month and day. Convert to Gregorian with toCalendar() before you trust a submitted value, or send v-model instead (nuxt/ui#6371). InputDateRange always submits Gregorian dates.
  • A ZonedDateTime shows a time zone segment that's a textbox, not a spinbutton, so it doesn't ring the frame when focused. Hide it with hide-time-zone.
  • TypeScript errors about "separate declarations of a private property" on CalendarDate mean two copies of @internationalized/date are installed. Keep one, with pnpm dedupe or an override (nuxt/ui#5965).

API Reference

Both components accept class, merged over their base classes.

Data attributes

data-slotAttributesDescription
input-datedata-variant, data-size, data-disabled, data-readonly, data-invalidThe frame, a role="group", holding the hidden form input. Inside an input group it is input-group-control.
input-date-rangedata-variant, data-size, data-disabled, data-readonly, data-invalidThe range's frame, the same as input-date, holding a hidden input for each end.
input-date-segmentdata-reka-date-field-segment, data-reka-date-range-field-segment-type, data-placeholder, data-disabled, data-invalid, aria-invalidOne segment, a role="spinbutton", or a literal such as the slash. In a range, data-reka-date-range-field-segment-type says which end it belongs to.
input-date-range-separatoraria-hiddenThe dash between the start and the end.

Accessibility

The frame is a group, labelled and described by its field. Each segment is a spinbutton with its own value and range, and reads "Empty" until it's filled. The literals and the range's dash are skipped.

  • The hidden form input takes the field's id, so clicking the label focuses the first segment.
  • Clicking the frame outside the segments focuses the first one too.
  • Invalid segments carry aria-invalid, and the frame turns destructive.
  • A readonly field stays in the tab order; a disabled one leaves it.
KeyAction
Tab / Shift + TabMoves through the segments, each one a tab stop, then out of the field.
0–9Types into the segment and moves to the next one when it is full. Typing into a full segment starts it over.
ArrowUp / ArrowDownSteps the segment by step, wrapping around.
ArrowLeft / ArrowRightMoves focus to the previous or next segment. In right-to-left they swap.
BackspaceDeletes the last digit, then empties the segment, which makes the value undefined. Focus stays on the segment.
A / PSets AM or PM in the 12-hour cycle.
Ctrl + V / ⌘ + VPastes an ISO date, 2025-03-14 or 2025-03-14T09:30. In a range, it fills the end that has focus; 2025-03-14/2025-03-21 fills both.
EnterSubmits the form like a native date input. It clicks the submit button and does nothing while that button is disabled; without one, it submits only when this is the form's single text field.

Changelog

  1. registry 0.13.0

    d9c272f — New DatePicker and DateRangePicker: an InputDate or InputDateRange with a calendar button that opens a Calendar or RangeCalendar in a popover, so a date can be typed or picked into the same v-model. <DatePicker v-model="date" /> renders the whole thing; the parts (DatePickerInput, DatePickerTrigger, DatePickerValue, DatePickerContent, DatePickerCalendar and their range twins) compose a layout of your own, including the shadcn-style outline button with DatePickerTrigger as-child. The field comes in Input's five variants and five sizes, the calendar follows the field's size unless it has its own, and inside an InputGroup the picker takes the group's frame. Picking a day closes the calendar (not when there are time segments, whose typed time a pick keeps), clicking the selected day keeps it, every month draws six weeks so the panel doesn't jump, and Alt+ArrowDown opens it from a segment. Focus on open lands on the selected day, today or the first day you can pick, never on a hidden copy from the neighbouring month. focus and blur fire once for the field, the button and the calendar together, so validate-on-blur doesn't flag the field while the calendar is open. In a Field, a button trigger takes the label, the description and the invalid state, and name submits through a hidden input: YYYY-MM-DD for a date, name[start] and name[end] for a range, with required needing both ends.

    936ab40 — New InputDate and InputDateRange: segmented date fields over Reka UI's DateField and DateRangeField, in Input's five variants and five sizes, with optional time segments, min-value/max-value, is-date-unavailable, loading and Field wiring. Inside an InputGroup they drop their own frame and take the group's variant and size. Pasting an ISO date (2025-03-14, or 2025-03-14T09:30) fills every segment, and Enter submits the form through its submit button, like a native date input. InputDateRange submits name[start] and name[end] as ISO dates, empty until that end is filled, and required needs both.

    InputTime and InputTimeRange get the same fixes. focus and blur now fire once when focus enters or leaves the field, so a form library's validate-on-blur runs; before, they never fired. Clicking the frame outside the segments focuses the first one, Enter submits the form, and changing granularity or hour-cycle after mount rebuilds the segments instead of leaving stale ones. InputTimeRange with name now submits name[start] and name[end] instead of one start - end field, which read undefined - undefined while empty and never failed required. If your server reads the old field, read the two new ones.

    0e81516 — Enter in InputDate, InputDateRange, InputTime and InputTimeRange follows a native input's implicit submission exactly: it clicks the form's submit button, does nothing while that button is disabled, and in a form without one submits only when the field is the form's single text field. Before, a form without a submit button was submitted whatever else it held.