npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-date-picker.json --yesDate picker
ProA field that opens a calendar to choose one date, typed or picked, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
- DatePickerPanelThe date control's month
- DatePickerTriggerWhat opens and closes the layer
- DatePickerValueThe chosen date's words in the trigger, or the placeholder in grey while no date is chosen
- DatePickerClearA quiet cross button beside the trigger that clears the chosen date, shown while one is chosen
- DatePickerContentThe layer (a
dialog: name it witharia-labeloraria-labelledby) - DatePickerHeaderThe top of the open layer, holding the field's label over the text field it names
- DatePickerLabelThe field's words, a
<label> - DatePickerInputThe layer's text field for a typed date
- DatePickerSeparatorThe hairline across the layer, under the head and its tabs and over the month
import {
DatePickerPanel, DatePicker, DatePickerTrigger, DatePickerValue, DatePickerClear, DatePickerContent, DatePickerHeader, DatePickerLabel, DatePickerInput, DatePickerSeparator,
} from '@/components/ui/goop/date-picker';
<div className="@container/chip-row flex items-center gap-2">
<DatePicker name="due">
<DatePickerTrigger placeholder="Due date" />
<DatePickerClear />
<DatePickerContent aria-label="Due date">
<DatePickerHeader>
<DatePickerLabel>Due date</DatePickerLabel>
<DatePickerInput error="Type a date such as 17 Nov" />
</DatePickerHeader>
<DatePickerPanel />
</DatePickerContent>
</DatePicker>
<DatePicker name="start">
<DatePickerTrigger shape="chip" label="Start date" iconOnly="narrow" />
<DatePickerContent aria-label="Start date">
<DatePickerPanel />
</DatePickerContent>
</DatePicker>
</div>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 calendar to choose one date, typed or picked.
- Also called: date input or calendar input.
When not to use
- For a date range use DateRangePicker, for a month in view Calendar.
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.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-date-picker.json --yesAdd the Goop Date picker to this project. The install steps are at https://goop.so/docs/install.mdUsage
import {
DatePickerPanel, DatePicker, DatePickerTrigger, DatePickerValue, DatePickerClear, DatePickerContent, DatePickerHeader, DatePickerLabel, DatePickerInput, DatePickerSeparator,
} from '@/components/ui/goop/date-picker';
<div className="@container/chip-row flex items-center gap-2">
<DatePicker name="due">
<DatePickerTrigger placeholder="Due date" />
<DatePickerClear />
<DatePickerContent aria-label="Due date">
<DatePickerHeader>
<DatePickerLabel>Due date</DatePickerLabel>
<DatePickerInput error="Type a date such as 17 Nov" />
</DatePickerHeader>
<DatePickerPanel />
</DatePickerContent>
</DatePicker>
<DatePicker name="start">
<DatePickerTrigger shape="chip" label="Start date" iconOnly="narrow" />
<DatePickerContent aria-label="Start date">
<DatePickerPanel />
</DatePickerContent>
</DatePicker>
</div>- Fits: flow, schedule (their recipes).
- height, width, padding, gap, corner, border, background, shadow, text, motion: add no class for these.
API reference
- Each option with its sentence: date-picker--options.md
- 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-state=open, data-today, data-outside-month, data-disabled, data-placeholder
| Part | What it is |
|---|---|
| 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 in the trigger, 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, holding the field's label over the text field it names |
| DatePickerLabel | The field's words, a <label>; also takes htmlFor?: string |
| DatePickerInput | The layer's text field for a typed date; refused or marked aria-invalid, its edge turns the danger colour; its props: date-picker--input.md |
| DatePickerSeparator | The hairline across the layer, under the head and its tabs and over the month |
DatePickerClear
A quiet cross button beside the trigger that clears the chosen date, shown while one is chosen.
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 text field for a typed date; refused or marked aria-invalid, its edge turns the danger colour.
import { DatePickerInput } from '@/components/ui/goop/date-picker';Options
- placeholder?: string = 'Type a date or choose one below' — The words shown while the field is empty.
- locale?: string — The language a date is written and read in (a BCP 47 tag; the page's, 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;
falserefuses them (the field is marked invalid). - error?: ReactNode — The error line 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
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 (
nullfor none); withonValueChange. - 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
nullwhen 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-state=open, data-today, data-outside-month, data-disabled, data-placeholder
DatePickerPanel
The date control's month.
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
todayif 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.
- 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 (a birth date):
captionList={DatePickerCaptionList}. - minDate?: Date — The first date a person can choose; the month pages back no further.
- maxDate?: Date — The last date a person can choose; 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 of the month's title, weekday heads and spoken day names, a BCP 47 tag (
de,fr-CA); the page's (<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. Or: A range: a first press its start, a second its end, a third starts over.
- value?: Date | null | DatePickerRange | null — The chosen date, when the caller holds it (
nullfor none); withonValueChange. Or: The chosen range, when the caller holds it. - 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
nullwhen it is pressed again. Or: Called with the range after each press (toundefined until its end is chosen), ornullfor none. - minNights?: number — The fewest nights a range spans; 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).
- Also takes: dir?: string
- Types: DatePickerMatcher = Matcher; DatePickerRange = { from: Date | undefined; to?: Date | undefined }
DatePickerTrigger
What opens and closes the layer.
import { DatePickerTrigger } from '@/components/ui/goop/date-picker';Options
- shape?: 'chip'
- label?: string — The property,
Due date: the start of the trigger's name ("Due date: 12 Nov 2026") and a chip's words while empty. - icon?: IconName = 'calendar' — The icon, by the pack's name.
- placeholder?: string = 'Pick a date' — The drawn trigger's words while no day is chosen, in grey.
- iconOnly?: boolean | 'narrow' = false — A chip as its icon alone:
truealways;'narrow'while its row, which must carry the class@container/chip-row(a create dialog's does), is under 641 px. - format?: (day: Date) => string — Writes the day in your own words; left out, "12 Nov 2026", or "Tomorrow" or "12 Nov" on a chip.
- locale?: string — The language of the default words (a BCP 47 tag; the page's, else the browser's, if left out).
- today?: Date — The date the chip's "Today" and "Tomorrow" count from; the clock's if left out.
- noneLabel?: string = 'none' — The word the chip's name says while no day is chosen ("Due date: none").
- Also takes: asChild?: boolean
DatePickerValue
The chosen date's words in the trigger, or the placeholder in grey while no date is chosen.
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; "12 Nov 2026" if left out.
- locale?: string — The language the default words are written in.
Keyboard
| Key | What it does |
|---|---|
| ArrowLeft ArrowRight | Move to the day before or after (the other way in right-to-left) |
| ArrowUp ArrowDown | Move a week back or on |
| Home End | Move to the first or last day of the week |
| PageUp PageDown | Move a month back or on, paging the month |
| Shift+PageUp Shift+PageDown | Move a year back or on |
| Enter Space | Choose the focused day |
Accessibility
- The native element answers the keyboard.
- hover, active: the browser's own (:hover, :active): write nothing
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| focus-visible | the attribute data-focus-visible |
| selected | the attribute data-selected |
| open | the attribute data-state=open |
| today | the attribute data-today |
| outside-month | the attribute data-outside-month |
| disabled | the attribute data-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.
- How the theme moves, and how to move your own parts the same way: Motion.
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.