# Calendar: Range limits

> `min` and `max` limit the range length in days. With `excludeDisabled`, a range that would include a disabled day starts over instead.

Example: https://hextaui.com/docs/calendar/examples/range-limits
Component docs: https://hextaui.com/docs/calendar.md

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/calendar-range-limits.json
```

This adds `components/examples/calendar/range-limits.tsx` with the Calendar component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/calendar/range-limits.tsx"
import { Calendar } from "@/components/ui/calendar"

export function CalendarRangeLimits() {
  return (
    <div className="w-fit max-w-full overflow-x-auto rounded-xl border">
      <Calendar
        mode="range"
        min={2}
        max={7}
        disabled={{ dayOfWeek: [0, 6] }}
        excludeDisabled
        footer="Weekdays only, 2–7 days."
      />
    </div>
  )
}
```

## Props in this example

### Calendar

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `mode` | `"single" \| "multiple" \| "range"` | – | Without a mode, days are not selectable. |
| `min` | `number` | – | Minimum days in a range, or selected in multiple mode. |
| `max` | `number` | – | Maximum days in a range, or selected in multiple mode. |
| `excludeDisabled` | `boolean` | – | Range mode. |
| `disabled` | `Matcher \| Matcher[]` | – |  |
| `footer` | `ReactNode` | – |  |

## More Calendar examples

- [Range](https://hextaui.com/docs/calendar/examples/range.md)
- [Multiple](https://hextaui.com/docs/calendar/examples/multiple.md)
- [Month and year dropdowns](https://hextaui.com/docs/calendar/examples/dropdowns.md)
- [Bounded](https://hextaui.com/docs/calendar/examples/bounded.md)
- [Controlled month](https://hextaui.com/docs/calendar/examples/controlled.md)
- [Week numbers](https://hextaui.com/docs/calendar/examples/week-numbers.md)
- [Fixed today](https://hextaui.com/docs/calendar/examples/fixed-today.md)
- [Inside a sheet](https://hextaui.com/docs/calendar/examples/sheet.md)
- [Right to left](https://hextaui.com/docs/calendar/examples/rtl.md)
