Skip to content
v0.2.10

DateRangePicker

Paired date entry with one calendar popup for continuous interval selection.

Preview

Use DateRangePicker

DateRangePicker is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
date-range-picker.tsxTSX
"use client";

import { FloodRoot, DateRangePicker } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <DateRangePicker label="Travel dates" startName="start" endName="end" today="2026-10-26" defaultValue={{start:"2026-10-12",end:"2026-10-18"}} />
    </FloodRoot>
  );
}

Design notes

  • Composes DateRangeField, RangeCalendar and the existing Popover engine. One popup selects start and end; it closes after an enabled complete interval.
  • The popup follows the whole fields region width and clamps to the viewport. Text and calendar editing share the same partial/complete range contract.
  • Controlled range/open state and availability remain host-owned. Escape/outside dismissal does not turn an incomplete range into a valid submission.
  • Translate endpoint, calendar and range instruction labels. Introduced in 0.2.7.

API reference

PropValuesDefault
hideLabelboolean—
minstring—
maxstring—
requiredboolean—
readOnlyboolean—
disabledboolean—
formstring—
controlSize"sm" | "md" | "lg" | "xl""md"
invalidboolean—
status"error" | "warning" | "success" | "info"—
descriptionstring—
order"month-day-year" | "day-month-year" | "year-month-day"—
segmentLabelsPartial<Record<"day" | "month" | "year", string>>—
messages{ required?: string; invalid?: string; outOfRange?: string }—
validationMessagestring—
labelstringRequired
valueDateRangeValue—
defaultValueDateRangeValue—
onValueChange(range: DateRangeValue) => void—
startNamestring—
endNamestring—
startLabelstring—
endLabelstring—
isDateDisabled(date: string) => boolean—
isRangeDisabled(range: DateRangeValue) => boolean—
rangeMessages{ incomplete?: string; reversed?: string; unavailable?: string }—
openboolean—
defaultOpenbooleanfalse
onOpenChange(open: boolean) => void—
calendarLabelstring—
openCalendarLabelstring—
localestring—
weekStartsOn0 | 1 | 2 | 3 | 4 | 5 | 6—
todaystring—
previousMonthLabelstring—
nextMonthLabelstring—
rangeLabelsRangeCalendarProps["rangeLabels"]—
Native HTML propsOmit<Omit<Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange" | "children">, "value" | "defaultValue" | "onValueChange" | "name" | "label" | "end">, "end">Forwarded
View TypeScript source