npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-date-range-picker.json --yesDate range picker
ProA field that opens a calendar to choose a range of dates, with presets beside it when given, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
- DateTimeRangePickerAn event's time block
- DateTimeRangePickerRepeatThe repeat button of an event's time block
- commonDateRangePresetsThe six presets a report's filter most often offers, counted from
today(the clock's if left out)
import { DateTimeRangePicker, DateTimeRangePickerRepeat } from '@/components/ui/goop/date-range-picker';
import { useState } from 'react';
import type { DatePickerRange } from '@/components/ui/goop/date-picker';
import { commonDateRangePresets, DateRangePicker } from '@/components/ui/goop/date-range-picker';
function SurveyPeriod() {
const [period, setPeriod] = useState<DatePickerRange | null>(null);
return (
<DateRangePicker
aria-label="Survey period"
name="period"
presets={commonDateRangePresets()}
maxDate={new Date()}
value={period}
onValueChange={setPeriod}
/>
);
}Pick a stay of two to fourteen nights from today on (a shorter or longer one is refused, past days are closed); pick a report period from a preset or the months; clear either. The line under each field says while its months are open. Nothing is booked or fetched: the lines under the fields only read the choice.
When to use
- A field that opens a calendar to choose a range of dates, with presets beside it when given.
- Also called: date range 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 range 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>/meadow-date-range-picker.json --yesAdd the Goop Date range picker to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { DateTimeRangePicker, DateTimeRangePickerRepeat } from '@/components/ui/goop/date-range-picker';
import { useState } from 'react';
import type { DatePickerRange } from '@/components/ui/goop/date-picker';
import { commonDateRangePresets, DateRangePicker } from '@/components/ui/goop/date-range-picker';
function SurveyPeriod() {
const [period, setPeriod] = useState<DatePickerRange | null>(null);
return (
<DateRangePicker
aria-label="Survey period"
name="period"
presets={commonDateRangePresets()}
maxDate={new Date()}
value={period}
onValueChange={setPeriod}
/>
);
}- Fits: overview, list: toolbar (time: span).
- width, padding, gap, corner, border, text, motion: add no class for these.
API reference
- Each option with its sentence: date-range-picker--options.md
- State: value (value / defaultValue / onValueChange); open (open / defaultOpen / onOpenChange); drawn by data-focus-visible, data-disabled, data-placeholder
| Part | What it is |
|---|---|
| DateTimeRangePicker | An event's time block; its props: date-range-picker--date-time-range-picker.md |
| DateTimeRangePickerRepeat | The repeat button of an event's time block; also takes type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean |
| commonDateRangePresets | The six presets a report's filter most often offers, counted from today (the clock's if left out) |
- data-slot values (to select a part by): date-range-picker, date-range-picker-body, date-range-picker-end, date-range-picker-icon, date-range-picker-presets, date-range-picker-text, date-range-picker-trigger, date-range-picker-value, date-time-range-picker, date-time-range-picker-all-day, date-time-range-picker-all-day-label, date-time-range-picker-arrow, date-time-range-picker-dates, date-time-range-picker-repeat, date-time-range-picker-repeat-button, date-time-range-picker-repeat-icon, date-time-range-picker-times
DateTimeRangePicker
An event's time block.
import { DateTimeRangePicker } from '@/components/ui/goop/date-range-picker';Options
- aria-label?: string = 'Date and time' — The block's name, said as its group's ("Date and time" if left out).
- value?: DatePickerRange | null — The chosen dates, when the caller holds them (
nullfor none); withonValueChange. - defaultValue?: DatePickerRange — The dates chosen at first, when the block holds them.
- onValueChange?: (value: DatePickerRange | null) => void — Called with the dates once a whole range is chosen.
- times?: TimeRange — The start and end times (
HH:MMon a 24-hour clock), when the caller holds them; withonTimesChange. - defaultTimes?: TimeRange — The times at first, when the block holds them.
- onTimesChange?: (times: TimeRange) => void — Called with both times after either changes.
- allDay?: boolean — Whether the event lasts all day, when the caller holds it; with
onAllDayChange. - defaultAllDay?: boolean = false — Whether it lasts all day at first.
- onAllDayChange?: (allDay: boolean) => void — Called as the all-day switch is turned.
- repeat?: ReactNode — What stands under the all-day switch:
<DateTimeRangePickerRepeat />, or your menu round it; nothing if left out. - name?: string — The form fields' name:
<name>-fromand<name>-to(the dates,YYYY-MM-DD),<name>-from-timeand<name>-to-time(HH:MM), and<name>-all-day(onwhile all day). - locale?: string — The language the times, the dates and the months are written in (a BCP 47 tag); the page's if left out.
- hourCycle?: 12 | 24 — The clock the times are written on: 12 or 24; the language's if left out.
- step?: number — The minutes between the times in a time's list; 15 if left out.
- minDate?: Date — The first date that can be chosen.
- maxDate?: Date — The last date that can be chosen.
- 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 in the months; the clock's if left out.
- disabled?: boolean — Whether the block is disabled: the times, the dates and the switch.
- container?: HTMLElement | null — Where the lists and the months are drawn; the end of
<body>when left out. - datesLabel?: string = 'Dates' — The dates' spoken name; "Dates" if left out.
- startTimeLabel?: string = 'Start time' — The start time's spoken name; "Start time" if left out.
- endTimeLabel?: string = 'End time' — The end time's spoken name; "End time" if left out.
- allDayLabel?: string = 'All day' — The all-day switch's words; "All day" if left out.
- Types: DatePickerRange = { from: Date | undefined; to?: Date | undefined }; TimeRange = { from?: string; to?: string }
DateRangePicker: every option
import { DateRangePicker } from '@/components/ui/goop/date-range-picker';Options
- id?: string — The trigger's id: a
Fieldhands it, so its label names the trigger (the chosen dates then describe it). - aria-label?: string — The field's name, said before the chosen dates ("Stay: Nov 12 2026 – Nov 19 2026"), and the layer's.
- value?: DatePickerRange | null — The chosen range, when the caller holds it (
nullfor none); withonValueChange. - defaultValue?: DatePickerRange — The range chosen at first, when the field holds it.
- onValueChange?: (value: DatePickerRange | null) => void — Called with a whole range once its end (or a preset) is chosen, or
nullwhen it is cleared. - name?: string — The form fields' name:
<name>-fromand<name>-toare sent asYYYY-MM-DD(empty while none is chosen). - placeholder?: string — The trigger's words while no range is chosen.
- format?: (range: DatePickerRange) => string — Writes the chosen range in the trigger; "Nov 12 2026 → Nov 19 2026" if left out.
- locale?: string — The language the trigger's words and the months are written in (a BCP 47 tag; the page's language, else the browser's, if left out).
- presets?: DateRangePreset[] — The presets listed beside the months; none if left out.
- open?: boolean — Whether the layer is open, when the caller holds it; with
onOpenChange. - defaultOpen?: boolean — Whether the layer is open at first.
- onOpenChange?: (open: boolean) => void — Called as the layer opens or closes.
- container?: HTMLElement | null — Where the layer is portalled; the end of
<body>when left out. - minDate?: Date — The first date that can be chosen; the months page back no further.
- maxDate?: Date — The last date that can be chosen; the months page on no further.
- disabled?: boolean — Whether the field is disabled: the trigger dimmed and skipped by Tab, no layer, no clear button, nothing sent with the form.
- disabledDays?: DatePickerMatcher | DatePickerMatcher[] — The days that cannot be chosen; a range never crosses one unless
allowDisabledInRange. - minNights?: number — The fewest nights a range spans.
- maxNights?: number — The most nights a range spans.
- allowDisabledInRange?: boolean — Let a range cross days that cannot be chosen.
- 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.
- clearLabel?: string — The clear button's spoken name.
- presetsLabel?: string — The presets list's spoken name;
Presetsby default. - State: value (value / defaultValue / onValueChange); open (open / defaultOpen / onOpenChange); drawn by data-focus-visible, data-disabled, data-placeholder
- Types: DatePickerRange = { from: Date | undefined; to?: Date | undefined }; DateRangePreset = { label: string; range: DatePickerRange }; DatePickerMatcher = Matcher
Keyboard
| Key | What it does |
|---|---|
| Enter Space | On the trigger: open the layer, the focus on the month's one tab stop (the chosen start, else today) |
| Tab Shift+Tab | From the trigger to the clear button; in the layer, among the presets, the arrows and the month's 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; in the presets: the row 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: a first press the range's start, a second its end, and with the end chosen the layer goes and the focus is back on the trigger (two presses: no one press shows it); in the presets, Enter chooses the row |
| Escape | Close the layer, the range as it was, the focus back on the trigger |
Accessibility
- The native element answers the keyboard.
- hover, active, focus-within: the browser's own (:hover, :active, :focus-within): 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 |
| 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.
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.