Component libraryDate range picker

Date range picker

Pro

Choose start and end dates with linked calendars.

npx shadcn@latest add @tidal-pro/date-range-picker
Desktop viewport

Installation

Pro source is gated. Configure the @tidal-pro registry using the agent guide. Create an access key from your account after purchasing.

Terminal
npx shadcn@latest add @tidal-pro/date-range-picker

Import components/ui/tidal.css, components/ui/date-range-picker.css, components/ui/date-picker.css, then add the component inside a tidal-scope wrapper. Its scoped design tokens keep it independent of your existing CSS.

Usage

Complete example source · Dependency and asset manifest

Loading the complete example…

API & behavior

Controlled value:TidalDateRange ({start:string|null,end:string|null}) and onValueChange; initialize with useState<TidalDateRange>({start:null,end:null}). Canonical Gregorian YYYY-MM-DD civil dates0001..9999. Two real type=date inputs submit name[start]/name[end], with individual startInputProps/endInputProps name/form/ID/native handlers overriding defaults. Native edits propose immediately and compose real native onChange/onInput; calendar picks edit an isolated draft and Apply proposes once, without forged native events. Cancel/Escape/outside discard the draft. Consumers own state, resets, requests and rejected proposals. Draft snapshots caller value on open; external caller changes do not replace an open draft. Optional min/max ISO bounds, inclusive minDays(default1)/maxDays, pure endpoint isDateDisabled(iso) and pure isRangeDisabled({start,end}) for whole-range/interior availability. The component never walks every interior date; callers implement full interval rules in isRangeDisabled. Malformed/reversed bounds and invalid length limits disable the group; malformed dates, reversed/partial/blocked/outside/too-short/too-long values show linked validity without clamping caller data. An optional empty pair is valid; a partial pair is invalid, and required makes both native fields required. Consumer error blocks editable native submission. Native readOnly inputs do not participate in HTML constraint validation; consumers must validate range values before requests. Native field refs through startRef/endRef; forwarded root ref targets the native fieldset. disabled excludes both dates from submission; readOnly submits values and disables calendar/Clear. Fieldset HTML props/className compose with native form bubbling, except root onKeyDown: set start/endInputProps.onKeyDown to intercept the native shortcuts. Native Alt+ArrowDown and trigger Enter/Space open a modal Radix Popover; caller field handlers run first, and preventDefault/composition is honored. Calendar one roving day Tab stop across one/two current-month grids; Arrows, row Home/End, Page keys and Shift+Page for civil month/year movement, RTL horizontal reversal and bounded clamps. Endpoint unavailable days are focusable/inspectable but cannot be chosen. First pick starts a new draft, second pick sorts its endpoints; another pick restarts. Hover/focus previews extend a persistent per-week band with travelling endpoint caps; invalid whole ranges remain visibly striped and cannot Apply. Month/year controls and optional fixed presets browse directly. Invalid year alert is linked, caller-localizable and direction-aware. Apply returns native opening-field/start focus; Escape returns the opening control. Optional todayISO(today prop; default local civil day), weekStartsOn0..6(default1), locale(defaulten-US, Gregorian UTC/fallbacken-US), months1/2/auto(defaultauto, two at760px viewport), presets, labels/messages, clearable(defaulttrue), theme/dir. At360px and below the popup fits a complete308px month grid with seven44px day targets. Explicit months=2 retains a horizontally scrollable strip between complete month grids; auto uses one month on phones. Visual-viewport clamping keeps the popup and fixed footer inside a short or keyboard-reduced viewport. Portal reads surrounding theme/direction on open. Labels include visible calendar text, calendarTitle, shortcuts, days(count) and yearRange(min,max); messages map typed validation codes. A viewport-fitted panel follows the field group and can straddle it to keep the calendar usable. Constrained popup fixes header/presets/footer and scrolls only its grid; minimum308px per month preserves44px days on narrow surfaces. Auto mode adapts to viewport changes. Native display follows OS/browser locale; decorative readout follows locale. Requires gated @tidal-pro/date-picker for shared civil helpers/digits, and import tidal.css/date-picker.css/date-range-picker.css. Exports tidalRangeDays (inclusive/null if incomplete, malformed or reversed) and tidalRangeIssue for validation. Finite range/popup/digit motion honors reduced motion. No form wrapper, reservation, scheduling, network or storage is introduced.

Style with the --t-* CSS variables. Set data-theme="dark" on your tidal-scope wrapper for a dark surface. Motion respects the system’s reduced-motion preference.

Building with an agent?Give it the installation guide and component catalog.