---
title: "Range Calendar"
description: "Pick a start and an end date on a month grid. A band joins the days between them, and two months can show side by side."
url: https://gelatinui.com/components/range-calendar
markdown_url: https://gelatinui.com/components/range-calendar.md
access: free
install: "npx shadcn@latest add @gelatin-ui/range-calendar"
registry_item: https://gelatinui.com/r/range-calendar.json
version: "2026-11-09"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Range Calendar

> Pick a start and an end date on a month grid. A band joins the days between them, and two months can show side by side.

Page: https://gelatinui.com/components/range-calendar

## When to use it

Best for: Picking a start date and an end date on a month grid that stays on the page.

- Use it when the grid can stay on the page, such as a hotel page.
- Use `isDateUnavailable(date, anchorDate)` to limit a range, such as seven nights at most.
- Use `allowsNonContiguousRanges` when a range may cross unavailable days.
- Use `commitBehavior` to set what happens when focus leaves a half range: `select`, `reset`, or `clear`.

## When not to use it

- For one date or many separate dates, use a [Calendar](https://gelatinui.com/components/calendar.md).
- For a range in a form field with a popup, use a [Date Range Picker](https://gelatinui.com/components/date-range-picker.md).

## Notes for agents

- `RangeCalendar` is the only part it owns. Import the other parts from Calendar (`CalendarMonths`, `CalendarGrid`, `CalendarCell`).
- `onValueChange` runs only with a full range, not after the first pick.
- The value is `{ start, end }`, with values from `@internationalized/date`.
- A month view shows six rows by default. Set `weeksInMonth="auto"` to use the rows of each month.
- `size` is `sm`, `default`, or `lg`. On a touch screen every size grows to 44px.

## Anatomy

```text
RangeCalendar
```

## API reference

### RangeCalendar

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `RangeValue<T> \| null` |  | The current value (controlled). |
| `defaultValue` | `RangeValue<T> \| null` |  | The default value (uncontrolled). |
| `aria-label` | `string` |  | Defines a string value that labels the current element. |
| `aria-labelledby` | `string` |  | Identifies the element (or elements) that labels the current element. |
| `aria-describedby` | `string` |  | Identifies the element (or elements) that describes the object. |
| `aria-details` | `string` |  | Identifies the element (or elements) that provide a detailed, extended description for the object. |
| `id` | `string` |  | The element's unique identifier. See MDN. |
| `dir` | `string` |  |  |
| `lang` | `string` |  |  |
| `hidden` | `boolean` |  |  |
| `inert` | `boolean` |  |  |
| `translate` | `"no" \| "yes"` |  |  |
| `suppressHydrationWarning` | `boolean` |  | A React-only flag that suppresses the warning React normally logs when an element's server-rendered content doesn't match the client render during hydration. See React docs. |
| `onClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onClickCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onAuxClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onAuxClickCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onContextMenu` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onContextMenuCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onDoubleClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onDoubleClickCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseDown` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseDownCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseEnter` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseLeave` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseMove` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseMoveCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseOut` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseOutCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseOver` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseOverCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseUp` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onMouseUpCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onTouchCancel` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchCancelCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchEnd` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchEndCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchMove` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchMoveCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchStart` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchStartCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onPointerDown` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerDownCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerMove` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerMoveCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerUp` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerUpCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerCancel` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerCancelCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerEnter` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerLeave` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOver` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOverCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOut` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOutCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onGotPointerCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onGotPointerCaptureCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onLostPointerCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onLostPointerCaptureCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onScroll` | `UIEventHandler<HTMLDivElement>` |  |  |
| `onScrollCapture` | `UIEventHandler<HTMLDivElement>` |  |  |
| `onWheel` | `WheelEventHandler<HTMLDivElement>` |  |  |
| `onWheelCapture` | `WheelEventHandler<HTMLDivElement>` |  |  |
| `onAnimationStart` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationStartCapture` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationEnd` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationEndCapture` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationIteration` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationIterationCapture` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onTransitionCancel` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionCancelCapture` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionEnd` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionEndCapture` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionRun` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionRunCapture` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionStart` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `onTransitionStartCapture` | `TransitionEventHandler<HTMLDivElement>` |  |  |
| `style` | `StyleOrFunction` |  | The inline style for the element. A function may be provided to compute the style based on component state. |
| `children` | `ChildrenOrFunction` |  | The children of the component. A function may be provided to alter the children based on component state. |
| `slot` | `string \| null` |  | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |
| `render` | `DOMRenderFunction` |  | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. |
| `minValue` | `DateValue \| null` |  | The minimum allowed date that a user may select. |
| `maxValue` | `DateValue \| null` |  | The maximum allowed date that a user may select. |
| `autoFocus` | `boolean` | false | Whether to automatically focus the calendar when it mounts. |
| `focusedValue` | `DateValue \| null` |  | Controls the currently focused date within the calendar. |
| `defaultFocusedValue` | `DateValue \| null` |  | The date that is focused when the calendar first mounts (uncontrolled). |
| `onFocusChange` | `function` |  | Handler that is called when the focused date changes. |
| `pageBehavior` | `PageBehavior` | visible | Controls the behavior of paging. Pagination either works by advancing the visible page by visibleDuration (default) or one unit of visibleDuration. |
| `firstDayOfWeek` | `"fri" \| "mon" \| "sat" \| "sun" \| "thu" \| "tue" \| "wed"` |  | The day that starts the week. |
| `selectionAlignment` | `"center" \| "end" \| "start"` | 'center' | Determines the alignment of the visible months on initial render based on the current selection or current date if there is no selection. |
| `allowsNonContiguousRanges` | `boolean` |  | When combined with `isDateUnavailable`, determines whether non-contiguous ranges, i.e. ranges containing unavailable dates, may be selected. |
| `isDateUnavailable` | `function` |  | Callback that is called for each date of the calendar. If it returns true, then the date is unavailable. The second argument provides the current selection anchor date, if any. This can be used to adjust the available dates based on the user's first selected date. |
| `commitBehavior` | `"clear" \| "reset" \| "select"` | 'select' | Controls the behavior when a pointer is released outside the calendar or a blur occurs mid selection: - `clear`: clear the currently selected range of dates. - `reset`: reset the selection to the previously selected range of dates. - `select`: select the currently hovered range of dates. |
| `visibleDuration` | `DateDuration` | { months: 1 } | The amount of days that will be displayed at once. This affects how pagination works. |
| `createCalendar` | `function` |  | A function to create a new Calendar object for a given calendar identifier. If not provided, the `createCalendar` function from `@internationalized/date` will be used. |
| `disabled` | `boolean` |  | Turns off the control: no focus, no edits, and the disabled look. |
| `readOnly` | `boolean` |  | The user can focus and read the value, but cannot change it. |
| `invalid` | `boolean` |  | Shows the invalid look and sets `aria-invalid`. |
| `onValueChange` | `function` |  | Runs on each change, with the new value and the Base UI change details. |
| `className` | `string` |  |  |
| `size` | `CalendarSize` | "default" | The cell size: `sm` 28, `default` 32, `lg` 36. On a touch screen every size grows to 44. |
| `weeksInMonth` | `number \| "auto"` |  | The rows of a month view. Default 6, so the height never changes when the user pages. `"auto"`: the rows of each month (4 to 6, React Aria). Week and day views ignore it. |
| `labels` | `Partial<{ weekNumber: string; }>` |  | The words (`CALENDAR_LABELS`), to translate them. Keep the object stable. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| RangeCalendar | `range-calendar` |  |  |  |

## Usage

The value is an object with `start` and `end`. Press once for the start and once for the end, or drag.

```tsx title="trip-dates.tsx"
import { parseDate } from "@internationalized/date";

import { RangeCalendar } from "@/components/ui/range-calendar";

export function TripDates() {
  return (
    <RangeCalendar
      aria-label="Trip dates"
      defaultValue={{ start: parseDate("2026-10-12"), end: parseDate("2026-10-16") }}
    />
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/range-calendar
```

It adds 40 registry items: 37 files, 6610 lines, and the npm packages `@base-ui/react`, `@internationalized/date`, `@mantine/hooks`, `@phosphor-icons/react`, `clsx`, `motion`, `react-aria-components`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Calendar](https://gelatinui.com/components/calendar.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Calendar](https://gelatinui.com/components/calendar.md): Pick Calendar for one date, or many single dates, on a month grid.
- [Date Range Picker](https://gelatinui.com/components/date-range-picker.md)
- [Date Picker](https://gelatinui.com/components/date-picker.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | Moves focus between the previous button, the next button, and the grid. |
| Left Arrow, Right Arrow | Moves focus one day back or on. Right to left swaps them. |
| Up Arrow, Down Arrow | Moves focus one row up or down. |
| Page Up, Page Down | Goes one month back or on. With Shift, goes one year. |
| Home, End | Goes to the start or the end of the month. |
| Enter, Space | Sets the start date, then the end date. |
| Escape | Drops a half range. |

## Accessibility

It is a React Aria range calendar. The month is a grid, and each day is a button in a grid cell.

Give it an `aria-label`, or put it next to a label that names it.

Enter sets the start, the arrow keys move the end, and a second Enter ends the range.

On a touch screen each cell grows to 44 × 44px, and the band grows with it.
