Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-date-range-picker.json --yes

Date range picker

Pro

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, for React and Tailwind CSS. Part of Goop Pro.

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.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-date-range-picker.json --yes
PROMPT
Add the Goop Date range picker to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
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
Parts
PartWhat it is
commonDateRangePresetsThe 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

TSX
import { DateRangePicker } from '@/components/ui/goop/date-range-picker';

Options

  • id?: string — The trigger's id: a Field hands 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 null when cleared.
  • name?: string — The form fields' name: <name>-from and <name>-to are sent as YYYY-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

KeyWhat it does
Enter SpaceOpen 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 ArrowDownMove a day or a week in the months, previewing the range to the day reached
PageUp PageDownMove a month back or on
Shift+PageUp Shift+PageDownMove a year back or on
Home EndMove to the first or last day of the week
ArrowUp / ArrowDown in the presetsMove between the presets; Enter chooses one and closes the layer
EscapeClose 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:

StateDrawn by
disabledthe prop disabled
placeholder-shownthe 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.

goop.so/themes/trail/components/date-range-picker.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-date-range-picker.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.