# DateRangePicker

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

Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.

## Example

```tsx
"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

| Prop | Values | Default |
| --- | --- | --- |
| `hideLabel` | `boolean` | `—` |
| `min` | `string` | `—` |
| `max` | `string` | `—` |
| `required` | `boolean` | `—` |
| `readOnly` | `boolean` | `—` |
| `disabled` | `boolean` | `—` |
| `form` | `string` | `—` |
| `controlSize` | `"sm" \| "md" \| "lg" \| "xl"` | `"md"` |
| `invalid` | `boolean` | `—` |
| `status` | `"error" \| "warning" \| "success" \| "info"` | `—` |
| `description` | `string` | `—` |
| `order` | `"month-day-year" \| "day-month-year" \| "year-month-day"` | `—` |
| `segmentLabels` | `Partial<Record<"day" \| "month" \| "year", string>>` | `—` |
| `messages` | `{ required?: string; invalid?: string; outOfRange?: string }` | `—` |
| `validationMessage` | `string` | `—` |
| `label` | `string` | `Required` |
| `value` | `DateRangeValue` | `—` |
| `defaultValue` | `DateRangeValue` | `—` |
| `onValueChange` | `(range: DateRangeValue) => void` | `—` |
| `startName` | `string` | `—` |
| `endName` | `string` | `—` |
| `startLabel` | `string` | `—` |
| `endLabel` | `string` | `—` |
| `isDateDisabled` | `(date: string) => boolean` | `—` |
| `isRangeDisabled` | `(range: DateRangeValue) => boolean` | `—` |
| `rangeMessages` | `{ incomplete?: string; reversed?: string; unavailable?: string }` | `—` |
| `open` | `boolean` | `—` |
| `defaultOpen` | `boolean` | `false` |
| `onOpenChange` | `(open: boolean) => void` | `—` |
| `calendarLabel` | `string` | `—` |
| `openCalendarLabel` | `string` | `—` |
| `locale` | `string` | `—` |
| `weekStartsOn` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6` | `—` |
| `today` | `string` | `—` |
| `previousMonthLabel` | `string` | `—` |
| `nextMonthLabel` | `string` | `—` |
| `rangeLabels` | `RangeCalendarProps["rangeLabels"]` | `—` |
| `Native HTML props` | `Omit<Omit<Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" \| "onChange" \| "children">, "value" \| "defaultValue" \| "onValueChange" \| "name" \| "label" \| "end">, "end">` | `Forwarded` |
