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
- Schedule a run
- Set a due date
- Pick a deploy time
- Filter by day
Examples
With time and limits
Installation
npx knowns-ui@latest add date-pickerPaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install Date picker from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/date-picker
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add date-picker
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/calendar/calendar.tsx
- components/ui/knowns/calendar/calendar-utils.ts
- components/ui/knowns/calendar/calendar-zone.ts
- components/ui/knowns/field-class.ts
- components/ui/knowns/use-floating.ts
- components/ui/knowns/popover.tsx
- components/ui/knowns/date-picker.tsx
- components/ui/knowns/date-picker-utils.ts
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/date-picker, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "date-picker" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.Props
- value / defaultValue / onValueChange
Date|null- Default
null - 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- Default
false / 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 }[]- Default
true - Today, Tomorrow, Next Monday, In a week, In a month.
- locale / weekStartsOn
string / number- Default
browser / 1 - Names, formatting, and the order typed numbers are read in (20/11 or 11/20).
- clearable
boolean- Default
true - 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).
| Prop | Type | Default | Description |
|---|---|---|---|
| value / defaultValue / onValueChange | Date | null | null | The day (with the time when time is on); null when cleared. |
| variant | "field" | "button" | "inline" | "field" | A typeable field with a calendar button, a field-style button, or the panel itself. |
| time / minuteStep | boolean / number | false / 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 }[] | true | Today, Tomorrow, Next Monday, In a week, In a month. |
| locale / weekStartsOn | string / number | browser / 1 | Names, formatting, and the order typed numbers are read in (20/11 or 11/20). |
| clearable | boolean | true | 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
- 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.
- 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.
- 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.
- 04Comes in three shapes through variant: a typeable field, a field-style button that opens the panel, and the panel itself inline.
- 05Disables days outside min and max or rejected by isDateDisabled, and explains a typed day it cannot use ("Pick Nov 20, 2026 or later").
- 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
| State | What moves | Timing |
|---|---|---|
| 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
- A span of days or a report period: use Date Range Picker.
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" }).