Skip to contentKino
Skip to Content

Date input

A date typed one segment at a time, in the order the locale writes it, where a highlight glides between the segments and each number rolls to its new value.

npx shadcn add https://kinoui.com/r/date-input.json
Share on

Examples

Default

Type the date, or step each segment with the arrow keys: the highlight follows you and each number rolls to its new value.

Locale

locale sets the order, separators and placeholders; without it, the field follows the browser’s language.

Month and year

granularity='month' drops the day, and the value is yyyy-mm; granularity='year' leaves the year alone, as yyyy.

Date and time

With granularity='minute' the Time input’s segments follow the date’s, joined as the locale joins them, and the value is yyyy-mm-ddTHH:mm. hour and second set how fine the time goes.

Type the month’s number or its first letters.

Month format

monthFormat='short' writes the month as a name, typed by its number or its first letters.

Any day in December.

Min and max

A date outside min and max shows as invalid, and a form won’t submit it.

Controlled

Hold the value with value and onValueChange; a value set from outside rolls each number the way it went.

Installation

npx shadcn@latest add https://kinoui.com/r/date-input.json
Files
lib/dates.tslib/segments.tslib/refs.tslib/field-control.tsxlib/segment-field.tsxlib/reduce-motion.tscomponents/kino/input.tsxlib/resize.tslib/run-progress.tslib/highlight.tslib/roll.tsxlib/scroll.tslib/segmented-input.tsxcomponents/kino/date-input.tsx
Packages
@base-ui/react

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

Props

PropTypeDefaultDescription
defaultValuestringnullNoneThe value at first, in the form granularity sets, when you leave the state to the field.
valuestringnullNoneThe value in the form granularity sets (yyyy-mm-dd by default), or null when it is empty, when you hold the state.
onValueChange(value: string | null) => voidNoneCalled once every segment holds a value that exists, and with null once every segment is empty. A half-typed date calls nothing.
granularity'year''month''day''hour''minute''second''day'The smallest unit typed, which sets the value’s form: yyyy, yyyy-mm, yyyy-mm-dd, or a date and time, yyyy-mm-ddTHH:mm (with :ss to the second, and :00 to the hour).
hourCycle1224NoneWith a time, a 12-hour clock with AM and PM, or a 24-hour one. The locale’s by default.
localestringNoneThe order, separators and placeholders. The browser’s language by default.
monthFormat'numeric''short''numeric'Writes the month as a number or as a short name.
minstringNoneThe earliest value allowed, in the value’s form or as a day. A month is allowed while any of its days is.
maxstringNoneThe latest value allowed, in the value’s form or as a day, which allows all of that day.
namestringNoneThe name the form sends the value under, in the value’s form. A Field’s name by default.
requiredbooleanNoneA form won’t submit it empty.
disabledbooleanNoneTurns every segment off.
readOnlybooleanNoneShows the date without letting it change.

Accessibility

  • Each segment is a spin button with its own name (day, month, year) and the field’s label: the arrow keys step it and wrap the day and month, Page Up and Page Down step a week, three months or five years, and Home and End go to its first and last value.
  • A segment moves on as soon as no other digit could follow, a separator key moves on, and Backspace on an empty segment goes back. Left and right arrows follow the screen, in right-to-left pages too.
  • Pasting 2026-11-14, or a date in the locale’s order, fills every segment.
  • An impossible or out-of-range date is invalid for the form and shows the invalid icon, so it never relies on colour alone.
  • When the system asks for less motion, the highlight moves in place and the numbers crossfade.