---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Date picker

A field that opens a month to choose one date, typed or picked, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `DatePicker`.

## Try it

Open the layer, pick a day in the month or type one ("tomorrow", "17 nov") and press Enter; clear it with the cross; Save shows the YYYY-MM-DD the form sends. The start-date chip beside it says its day in words (“Tomorrow”, “12 Nov”), opens on Enter, Space or Down, and its Soon tab sets the day at once. Under them, type a reminder day ("21 nov", "tomorrow") and press Enter: the page reads it and says it, and words it cannot read are refused. Paging the due date’s month is said under the form too.

Nothing is saved: Save only reads the form, and the reminder is only written under it.

## When to use

- A field that opens a month to choose one date, typed or picked.
- Also called: date input or calendar input.

## Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Date picker on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-date-picker.json --yes
```

```text
Add the Goop Date picker to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { DatePickerValue, DatePickerClear, DatePickerLabel, DatePickerSeparator } from '@/components/ui/goop/date-picker';

import {
  DatePicker,
  DatePickerContent,
  DatePickerHeader,
  DatePickerInput,
  DatePickerPanel,
  DatePickerTrigger,
} from '@/components/ui/goop/date-picker';

function VisitDate({ onPick }: { onPick: (day: Date | null) => void }) {
  return (
    <DatePicker name="visit" onValueChange={onPick}>
      <DatePickerTrigger placeholder="Visit date" />
      <DatePickerContent aria-label="Visit date">
        <DatePickerHeader>
          <DatePickerInput aria-label="Type a date" />
        </DatePickerHeader>
        <DatePickerPanel />
      </DatePickerContent>
    </DatePicker>
  );
}
```

- height, width, padding, gap, corner, border, background, text, motion: add no class for these.

## API reference

### Parts

- `DatePickerPanel` — The date control's month; its props: date-picker--panel.md
- `DatePickerTrigger` — What opens and closes the layer; its props: date-picker--trigger.md
- `DatePickerValue` — The chosen date's words, or the placeholder in grey while no date is chosen; its props: date-picker--value.md
- `DatePickerClear` — A quiet cross button beside the trigger that clears the chosen date, shown while one is chosen; its props: date-picker--clear.md
- `DatePickerContent` — The layer (a `dialog`: name it with `aria-label` or `aria-labelledby`); also takes container?: HTMLElement | null; frameClassName?: string
- `DatePickerHeader` — The top of the open layer
- `DatePickerLabel` — The field's words, a `<label>`; also takes htmlFor?: string
- `DatePickerInput` — The layer's field for a typed date; its props: date-picker--input.md
- `DatePickerSeparator` — The hairline across the layer, between a caller's own parts and the month (the header draws its own)

### DatePickerClear

A quiet cross button beside the trigger that clears the chosen date, shown while one is chosen.

```tsx
import { DatePickerClear } from '@/components/ui/goop/date-picker';
```

### Options

- label?: string = 'Clear date' — The button's spoken name.
- Also takes: type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean; tooltip?: string | false; tooltipKeys?: readonly string[]; loading?: boolean = false; loadingLabel?: string = 'Loading'

### DatePickerInput

The layer's field for a typed date.

```tsx
import { DatePickerInput } from '@/components/ui/goop/date-picker';
```

### Options

- placeholder?: string = 'Type a date' — The words shown while the field is empty.
- locale?: string — The language the chosen date is written and a typed one read in (a BCP 47 tag; the page's language, else the browser's, if left out).
- onValueCommit?: (words: string) => boolean | void — Called with the typed words on Enter or as the field is left; `false` refuses them (the field is marked invalid).
- error?: ReactNode — The sentence shown under the field while what was typed is refused.
- Also takes: value?: string; defaultValue?: string; onChange?: (event: ChangeEvent<HTMLInputElement>) => void; name?: string; required?: boolean; disabled?: boolean; form?: string

### DatePicker: every option

```tsx
import { DatePicker } from '@/components/ui/goop/date-picker';
```

### Options

- id?: string
- aria-describedby?: string
- aria-invalid?: boolean | 'true' | 'false'
- disabled?: boolean
- value?: Date | null — The chosen date, when the caller holds it (`null` for none); with `onValueChange`.
- defaultValue?: Date — The date chosen at first, when the field holds it.
- onValueChange?: (value: Date | null) => void — Called with the date chosen (in the month or typed), or `null` when it is cleared.
- name?: string — The form field's name: a hidden field sends the chosen date as `YYYY-MM-DD`.
- Also takes: open?: boolean; defaultOpen?: boolean = false; onOpenChange?: (open: boolean) => void; modal?: boolean
- Takes every prop of Popover (its page: popover.md)
- State: value (value / defaultValue / onValueChange); open (open / defaultOpen / onOpenChange); drawn by data-focus-visible, data-selected, data-outside-month, data-placeholder

### DatePickerPanel

The date control's month.

```tsx
import { DatePickerPanel } from '@/components/ui/goop/date-picker';
```

### Options

- month?: Date — The first month shown, when the caller holds it; with `onMonthChange`.
- defaultMonth?: Date — The first month shown at first, when the panel holds it; the month of `today` if left out.
- onMonthChange?: (month: Date) => void — Called with the first date of the month paged to, by a button or a key.
- numberOfMonths?: number = 1 — How many months are shown side by side, wrapping; the paging buttons sit once, in the last month's caption.
- disabledDays?: DatePickerMatcher | DatePickerMatcher[] — The days a person cannot choose.
- disabled?: boolean — Whether the month is disabled: every day refused (the paging still pages).
- captionList?: ComponentType<DropdownProps> — A month list and a year list in place of the month's title, for a far date such as a birth date: the date library's dropdown part (`ComponentType<DropdownProps>`).
- minDate?: Date — The first date a person can choose: the dates before it cannot be chosen, and the month pages back no further.
- maxDate?: Date — The last date a person can choose: the dates after it cannot be chosen, and the month pages on no further.
- weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6 — The weekday a week starts on, 0 for Sunday to 6 for Saturday.
- today?: Date — The date marked as today; the clock's if left out.
- locale?: string — The language the month's title, the weekday letters and every spoken day name are written in, a BCP 47 tag (`de`, `fr-CA`); the page's language (`<html lang>`), else the browser's, if left out.
- dateLocale?: Partial<DayPickerLocale>
- autoFocus?: boolean — Move the focus to the grid's tab stop when the panel mounts.
- previousLabel?: string = 'Previous month' — The previous-month button's name.
- nextLabel?: string = 'Next month' — The next-month button's name.
- mode?: 'single' | 'range' = 'single' — One date is chosen at a time (the default). Or: A range of dates is chosen: a first press its start, a second its end in date order, a third starts over.
- value?: Date | null | DatePickerRange | null — The chosen date, when the caller holds it (`null` for none); with `onValueChange`. Or: The chosen range, when the caller holds it (`null` for none); with `onValueChange`.
- defaultValue?: Date | DatePickerRange — The date chosen at first, when the panel holds it. Or: The range chosen at first, when the panel holds it.
- onValueChange?: ((value: Date | null) => void) | ((value: DatePickerRange | null) => void) — Called with the date chosen, or `null` when it is pressed again. Or: Called with the range after each press (`to` undefined until its end is chosen), or `null` for none.
- minNights?: number — The fewest nights a range spans (its end this many days after its start); a shorter one starts over.
- maxNights?: number — The most nights a range spans; a longer one starts over at the pressed date.
- allowDisabledInRange?: boolean = false — Let a range cross days that cannot be chosen (its ends still can't be one); off by default.
- Also takes: dir?: string
- Types: DatePickerMatcher = Matcher; DatePickerRange = { from: Date | undefined; to?: Date | undefined }

### DatePickerTrigger

What opens and closes the layer.

```tsx
import { DatePickerTrigger } from '@/components/ui/goop/date-picker';
```

### Options

- shape?: 'chip' — `chip`: a record's quiet value, drawn by the trigger itself (no child): the chosen day's words ("Nov 25 2026"), and while none is chosen the property's `label` (else `placeholder`) in grey.
- label?: string — The property, `Due date`: the start of the trigger's name ("Due date: Nov 25 2026"); a chip's words while empty.
- icon?: IconName — The icon, by the pack's name; `calendar` by default (a chip draws it only folded, `iconOnly`).
- placeholder?: string = 'Pick a date' — The drawn trigger's words while no day is chosen, in grey; `Pick a date` by default.
- iconOnly?: boolean | 'narrow' = false — A chip as its icon alone, its words in a tooltip: `true` always; `'narrow'` while its row, which must carry the class `@container/chip-row`, is under 641 px.
- format?: (day: Date) => string — Writes the day in your own words; left out, "Nov 25 2026" in the page's language.
- locale?: string — The language the default words are written in (a BCP 47 tag; the page's language, else the browser's, if left out).
- today?: Date
- noneLabel?: string = 'none' — The word the chip's name says while no day is chosen ("Due date: none"); `none` by default.
- Also takes: asChild?: boolean

### DatePickerValue

The chosen date's words, or the placeholder in grey while no date is chosen.

```tsx
import { DatePickerValue } from '@/components/ui/goop/date-picker';
```

### Options

- placeholder?: string = 'Pick a date' — The words shown while no date is chosen.
- format?: (day: Date) => string — Writes the chosen date; "Nov 25 2026" if left out.
- locale?: string — The language the default words are written in.

## Keyboard

- Enter: on the trigger: open, the focus in the field
- Space: on the trigger: open, the focus in the field
- Tab / Shift+Tab: move from the field to the arrows and the month's one tab stop
- ArrowLeft / ArrowRight: in the month: the day before or after (mirrored right to left)
- ArrowUp / ArrowDown: in the month: the same day a week before or after
- Home / End: in the month: the week's first or last day
- PageUp / PageDown: in the month: the same day a month before or after; with Shift a year
- Enter / Space: in the month: choose the day, close the layer, the focus back on the trigger
- Escape: close, the focus back on the trigger (in a field holding typed words: put the day's words back first)

## Accessibility

- The native element answers the keyboard.
- hover, active: the browser's own (:hover, :active): write nothing
- focus-visible: the attribute data-focus-visible
- selected: the attribute data-selected
- outside-month: the attribute data-outside-month
- disabled: the prop disabled
- invalid: the attribute aria-invalid
- placeholder-shown: the attribute data-placeholder

## Motion

- The part sets its own motion: add no transition or animation of your own.

## Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

Shortened to fit: the data-slot values.

## Related

- [Month and year list](/themes/meadow/components/date-picker-choices): A month list or a year list in a month's caption, for a far date such as a date of birth.
- [Date range picker](/themes/meadow/components/date-range-picker): A field that opens a calendar to choose a range of dates, with presets beside it when given.
- [Time picker](/themes/meadow/components/time-picker): A field for a time of day that a person types or picks from a list, such as a meeting's start.
- [Wizard](/themes/meadow/components/wizard): A flow the user goes through one step at a time, with back and next buttons.
