npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-date-picker-choices.json --yesMonth and year list
ProA month list or a year list in a month's caption, for a far date such as a date of birth, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
- DatePickerAnyPanelThe panel for leaving the date open, one line of words
- DatePickerRecurringPanelThe panel for a repeating date, daily, weekly or monthly
- DatePickerSoonPanelThe panel of quick choices, Today to This month
- datePickerRepeatWordsA repeat in words
- datePickerSoonRangeThe days a quick choice stands for, counted from
today - datePickerChoiceWordsA choice in words, as the layer's field shows it
- parseDatePickerDayA day typed in the field, read leniently
- parseDatePickerRangeA range typed in the field
import { datePickerRepeatWords, datePickerSoonRange, parseDatePickerDay, parseDatePickerRange, DatePickerAnyPanel, DatePickerRecurringPanel } from '@/components/ui/goop/date-picker-choices';
import { useState } from 'react';
import { Calendar } from '@/components/ui/goop/calendar';
import {
DatePickerCaptionList,
type DatePickerChoice,
DatePickerSoonPanel,
datePickerChoiceWords,
} from '@/components/ui/goop/date-picker-choices';
function BirthAndDue() {
const [due, setDue] = useState<DatePickerChoice>();
return (
<div className="flex flex-col gap-4">
<Calendar
aria-label="Date of birth"
captionList={DatePickerCaptionList}
minDate={new Date(1920, 0, 1)}
maxDate={new Date()}
/>
<DatePickerSoonPanel
value={due?.mode === 'soon' ? due.key : null}
onValueChange={(_key, choice) => setDue(choice)}
/>
<p className="text-sm text-muted-foreground">{datePickerChoiceWords(due) || 'No due date'}</p>
</div>
);
}Open the picker and choose a day, a range, any time, a repeat (weekdays or a day of the month) or a quick “soon” choice, or type one (“17 nov”, “1 dec - 5 dec”) and press Enter. The button says it in words; the line under it says what a form would keep. Nothing is saved; the line only shows what the choice holds.
When to use
- A month list or a year list in a month's caption, for a far date such as a date of birth.
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 Month and year list 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>/meadow-date-picker-choices.json --yesAdd the Goop Month and year list to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { datePickerRepeatWords, datePickerSoonRange, parseDatePickerDay, parseDatePickerRange, DatePickerAnyPanel, DatePickerRecurringPanel } from '@/components/ui/goop/date-picker-choices';
import { useState } from 'react';
import { Calendar } from '@/components/ui/goop/calendar';
import {
DatePickerCaptionList,
type DatePickerChoice,
DatePickerSoonPanel,
datePickerChoiceWords,
} from '@/components/ui/goop/date-picker-choices';
function BirthAndDue() {
const [due, setDue] = useState<DatePickerChoice>();
return (
<div className="flex flex-col gap-4">
<Calendar
aria-label="Date of birth"
captionList={DatePickerCaptionList}
minDate={new Date(1920, 0, 1)}
maxDate={new Date()}
/>
<DatePickerSoonPanel
value={due?.mode === 'soon' ? due.key : null}
onValueChange={(_key, choice) => setDue(choice)}
/>
<p className="text-sm text-muted-foreground">{datePickerChoiceWords(due) || 'No due date'}</p>
</div>
);
}- Fits: flow, settings: field.
- width, padding, gap, background, text: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| Defaults | options = [] |
- Types: DatePickerRepeat = { every: 'day' } | { every: 'week'; weekdays: number[] } | { every: 'month'; day: number }; DatePickerSoonKey = 'today' | 'tomorrow' | 'this-week' | 'next-week' | 'this-month'
| Part | What it is |
|---|---|
| DatePickerAnyPanel | The panel for leaving the date open, one line of words; children replace the default sentence |
| DatePickerRecurringPanel | The panel for a repeating date, daily, weekly or monthly; value and onValueChange hold the repeat; value?: DatePickerRepeat — The repeat shown, held by the page with onValueChange; defaultValue?: DatePickerRepeat — The repeat shown first when the panel holds its own; onValueChange?: (value: DatePickerRepeat) => void — Called with the repeat as each control leaves it |
| DatePickerSoonPanel | The panel of quick choices, Today to This month; value is the chosen key, onValueChange hears a pick; value?: 'today' | 'tomorrow' | 'this-week' | 'next-week' | 'this-month' | null — The chosen quick choice, null for none, held by the page with onValueChange; defaultValue?: 'today' | 'tomorrow' | 'this-week' | 'next-week' | 'this-month' — The quick choice chosen first when the panel holds its own; onValueChange?: (value: 'today' | 'tomorrow' | 'this-week' | 'next-week' | 'this-month', choice: Extract<DatePickerChoice, { mode: 'soon' }>) => void — Called with the quick choice pressed (or chosen with Enter), and the choice with its days counted from today; today?: Date — The date the choices count from; the clock's if left out |
| datePickerRepeatWords | A repeat in words |
| datePickerSoonRange | The days a quick choice stands for, counted from today |
| datePickerChoiceWords | A choice in words, as the layer's field shows it |
| parseDatePickerDay | A day typed in the field, read leniently |
| parseDatePickerRange | A range typed in the field |
Keyboard
| Key | What it does |
|---|---|
| ArrowLeft ArrowRight | Move between the five tabs, each opening its panel |
| Tab | Move from the tabs into the panel: the repeat's list, each weekday toggle, the day's list, or the quick choices' list; on the Day tab the caption's month and year lists, then the month |
| Space / Enter on a weekday | Press or release that day of a weekly repeat |
| ArrowUp / ArrowDown in the quick choices | Move between the quick choices; Enter chooses the one reached |
| Escape | Close the layer; the focus returns to what opened it |
Accessibility
- The part itself answers the keys above.
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| pressed | the attribute aria-pressed |
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.