npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-date-range-picker.json --yesDate range picker
ProA date range field that opens a calendar to choose a start and an end date, with presets such as the last 7 days beside it when given, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
- commonDateRangePresetsThe six presets a report's filter most often offers, counted from
today(the clock's if left out)
import { commonDateRangePresets, DateRangePicker } from '@/components/ui/goop/date-range-picker';
<DateRangePicker aria-label="Period" name="period" presets={commonDateRangePresets()} maxDate={new Date()} />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 date range field that opens a calendar to choose a start and an end date, with presets such as the last 7 days 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>/trail-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 { commonDateRangePresets, DateRangePicker } from '@/components/ui/goop/date-range-picker';
<DateRangePicker aria-label="Period" name="period" presets={commonDateRangePresets()} maxDate={new Date()} />- Fits: overview (its recipe); overview, list: toolbar (time: span).
- width, padding, gap, corner, border, text: 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-placeholder
| Part | What it is |
|---|---|
| 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-presets, date-range-picker-value
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. - aria-label?: string — The field's name, said before the chosen dates ("Stay: 12 Nov – 19 Nov 2026"), and the layer's.
- value?: DatePickerRange | null — The chosen range, when the caller holds it.
- 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 cleared. - name?: string — The form fields' name:
<name>-fromand<name>-toare sent asYYYY-MM-DD. - placeholder?: string = 'Pick dates' — The trigger's words while no range is chosen.
- format?: (range: DatePickerRange) => string — Writes the chosen range in the trigger; "12 Nov – 19 Nov 2026" if left out.
- locale?: string — The language of the trigger's words and the months (a BCP 47 tag; the page's, 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 = false — 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, 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 = 'Clear dates' — The clear button's spoken name.
- presetsLabel?: string = 'Presets' — The presets list's spoken name.
- State: value (value / defaultValue / onValueChange); open (open / defaultOpen / onOpenChange); drawn by data-placeholder
- Types: DatePickerRange = { from: Date | undefined; to?: Date | undefined }; DateRangePreset = { label: string; range: DatePickerRange }; DatePickerMatcher = Matcher
Keyboard
| Key | What it does |
|---|---|
| Enter Space | Open the layer from the trigger; on a day, choose it (the first a range's start, the second its end, which closes the layer) |
| ArrowLeft ArrowRight ArrowUp ArrowDown | Move a day or a week in the months, previewing the range to the day reached |
| PageUp PageDown | Move a month back or on |
| Shift+PageUp Shift+PageDown | Move a year back or on |
| Home End | Move to the first or last day of the week |
| ArrowUp / ArrowDown in the presets | Move between the presets; Enter chooses one and closes the layer |
| Escape | Close the layer; the focus returns to the trigger |
Accessibility
- The native element answers the keyboard.
- focus-visible: the browser's own (:focus-visible): write nothing
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| disabled | the prop disabled |
| placeholder-shown | the attribute data-placeholder |
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.