skrewww

Forms

Date Picker

Date Picker is a date-only field with editable D MMM YYYY text entry (en-GB) and calendar popover for single-date selection.

State × Size — 5 variants

betaReact AvailableFigma AvailableDocs Partial
React last updated
2026-07-13
Documentation last updated
2026-06-01
Accessibility target
WCAG 2.2 AA (target)
Version
0.5.0-beta

Known open questions

  • Custom formatDate/parseDate pairs override locale display when both are provided.

Live preview

Editable text field (D MMM YYYY, en-GB) with calendar popover. Type a date or pick from the grid.

Empty / selected / required / disabled / error

ISO YYYY-MM-DD is submitted.

Choose a valid date.

Typed and picked dates must fall in range.

Hidden input submits canonical YYYY-MM-DD values. The visible field accepts and displays D MMM YYYY text (en-GB only, e.g. 11 Jul 2026).

Purpose

Text-input-style entry for a calendar date, intended to trigger a calendar popover for visual date selection.

Anatomy

Date Picker composes FormField + editable text input + calendar button + Popover + Calendar Grid + hidden YYYY-MM-DD input.

Variants and states

single-date

When to use

Any date-entry field where a calendar picker aids accuracy over free-typing.

When not to use

When only a rough date/timeframe matters.

Accessibility

The calendar icon should trigger the same popover as clicking the input itself; both need to be keyboard operable.

Keyboard behavior

Calendar button opens the popover. Text field accepts D MMM YYYY entry (blur/Enter to commit). Calendar Grid handles day navigation. Escape closes and restores trigger focus.

Common mistakes

Assuming this component includes the calendar grid — pair it with Content/Calendar for the full picker.

Properties

State × Size as variants. Value (text, formatted date string).

Should Date Picker allow direct text entry?

Yes — the text field accepts D MMM YYYY (en-GB only, e.g. 11 Jul 2026). Invalid, out-of-range, or disabled dates show a visible validation error. Numeric regional formats are not accepted.

How is the selected date submitted in a form?

A hidden input submits canonical YYYY-MM-DD. Display text is not submitted.

What is the difference between Date Picker and Calendar Grid?

Calendar Grid is the month selection surface. Date Picker wraps it in a labelled field with popover trigger behavior.

How does Date Picker avoid time-zone date shifts?

Values are stored and submitted as date-only YYYY-MM-DD strings using local calendar arithmetic — never UTC midnight conversion.

Tokens used

component/radius/controlsemantic/border/defaultsemantic/icon/muted

Component API

PropTypeDefaultDescription
labelstringField label via FormField.
valueYYYY-MM-DDControlled selected date.
defaultValueYYYY-MM-DDInitial selected date.
onValueChange(date) => voidSelection callback.
namestringHidden input name for form submission.
requiredbooleanRequired field indicator.
disabledbooleanPrevents opening and submission.
readOnlybooleanPrevents editing and opening while remaining perceivable.
errorstringValidation message via FormField.
minDateYYYY-MM-DDEarliest selectable date, inclusive.
maxDateYYYY-MM-DDLatest selectable date, inclusive.
isDateDisabled(date) => booleanAdditional disabled-date predicate.

React example

Copy React example
import { DatePicker } from "@/components/ui/DatePicker";

export function Example() {
  return (
    <DatePicker
      label="Release date"
      name="release-date"
      defaultValue="2026-07-11"
    />
  );
}