Skip to content

Date Picker

One date, optionally with a time. Type it the way you would say it (tomorrow, next fri, 20/11, Nov 20, in 3 days, 3pm) and the field shows what it understood before you commit, or pick from the calendar and quick picks. Intl only, no date library.

On this page
Used for
  • Schedule a run
  • Set a due date
  • Pick a deploy time
  • Filter by day

Examples

Variant

With time and limits

Installation

npx knowns-ui@latest add date-picker
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

value / defaultValue / onValueChange
Date | null
Defaultnull
The day (with the time when time is on); null when cleared.
variant
"field" | "button" | "inline"
Default"field"
A typeable field with a calendar button, a field-style button, or the panel itself.
time / minuteStep
boolean / number
Defaultfalse / 15
Adds a time. Typed times (3pm, 15:30, noon) and the time input both set it.
min / max / isDateDisabled
Date / (d) => boolean
Days that can't be picked; typed ones get a reason ("Pick Nov 10, 2026 or later").
quickPicks
boolean | { id, label, date }[]
Defaulttrue
Today, Tomorrow, Next Monday, In a week, In a month.
locale / weekStartsOn
string / number
Defaultbrowser / 1
Names, formatting, and the order typed numbers are read in (20/11 or 11/20).
clearable
boolean
Defaulttrue
Emptying the field or Clear in the panel sets null.
size / invalid / disabled / id / name / aria-*
Like the other form controls. name adds a hidden ISO value for plain forms (button variant).

Keyboard: type and press Enter (or Tab away) to commit; Escape restores the last value; Alt+Down opens the calendar, where arrows move by day and week, Page Up/Down by month. Two-part dates without a year take the next such day. For a range of days, use Date Range Picker.

What it handles

  1. 01Reads typed text as a date: ISO, numbers in the locale's day and month order, month names, today, tomorrow, next fri and in 3 days.
  2. 02Shows what it understood under the caret as you type, and commits on blur or Enter; Escape drops the draft and Alt+ArrowDown opens the panel.
  3. 03Turns on a time with the time prop, so "tomorrow 3pm" or "15:30" typed in the field sets the hour, and a time input steps by minuteStep.
  4. 04Comes in three shapes through variant: a typeable field, a field-style button that opens the panel, and the panel itself inline.
  5. 05Disables days outside min and max or rejected by isDateDisabled, and explains a typed day it cannot use ("Pick Nov 20, 2026 or later").
  6. 06Lists quick picks beside the month grid (Today, Tomorrow, Next Monday, In a week, In a month), which you can replace with your own array.

States

First render
Nothing. The field paints as it is
none
Typing
The parsed date or the reason it fails appears at the right of the field
none, at once
Panel opens
The panel fades in under the trigger
120ms, opacity only
Quick pick hover
The row background changes
120ms, ease out
Reduced motion
The panel appears and leaves at once
0ms

Works with

When to use

When to use

  • One date in a form: a due date, a birthday, a meeting with a time.
  • Fields where typing is faster than clicking: "tomorrow 3pm", "next fri".

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Date Picker to my app and wire it to my own data.
  • I need one date in a form: a due date, a birthday, a meeting with a time. Set that up with the Knowns UI Date Picker.
  • Which Date Picker props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "date-picker" }) and search_docs({ query: "date picker" }).

Need help?

Stuck on Date Picker, or found something off? We read every message.