# RangeCalendar

A Gregorian grid for selecting and previewing one continuous date interval.

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, RangeCalendar } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <RangeCalendar label="Choose travel dates" today="2026-10-26" defaultValue={{start:"2026-10-12",end:"2026-10-18"}} />
    </FloodRoot>
  );
}
```

## Design notes

- The first activation chooses a start; the second completes a normalized ordered interval. Hover and focus can preview an unfinished interval without committing.
- Controlled values include partial {start,end:""}; the host must accept that partial value to advance selection. onRangeSelect confirms an enabled completed interval.
- isDateDisabled controls endpoints. isRangeDisabled validates the entire interval; interior blocked dates are not inferred by scanning arbitrary date spans.
- Reuses the Calendar grid, month navigation, focus and localization contracts. Translate rangeLabels for instruction messages. Introduced in 0.2.7.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `label` | `string` | `Required` |
| `showViewControls` | `boolean` | `—` |
| `viewLabels` | `{month?:string;year?:string;previous?:string;next?:string}` | `—` |
| `visibleMonth` | `string` | `—` |
| `defaultVisibleMonth` | `string` | `—` |
| `onVisibleMonthChange` | `(month: string) => void` | `—` |
| `min` | `string` | `—` |
| `max` | `string` | `—` |
| `disabled` | `boolean` | `—` |
| `readOnly` | `boolean` | `—` |
| `isDateDisabled` | `(date: string) => boolean` | `—` |
| `weekStartsOn` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6` | `0` |
| `locale` | `string` | `"en-US"` |
| `autoFocus` | `boolean` | `false` |
| `today` | `string` | `—` |
| `previousMonthLabel` | `string` | `—` |
| `nextMonthLabel` | `string` | `—` |
| `value` | `DateRangeValue` | `—` |
| `defaultValue` | `DateRangeValue` | `—` |
| `onValueChange` | `(range: DateRangeValue) => void` | `—` |
| `onRangeSelect` | `(range: DateRangeValue) => void` | `—` |
| `isRangeDisabled` | `(range: DateRangeValue) => boolean` | `—` |
| `rangeLabels` | `{ chooseStart?: string; chooseEnd?: string; unavailable?: string }` | `—` |
| `Native HTML props` | `Omit<Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" \| "onChange" \| "children">, "value" \| "defaultValue" \| "onValueChange" \| "onDateSelect" \| "granularity">` | `Forwarded` |
