---
title: Calendar
description: A calendar component that allows users to select a date or a range of dates.
base: aria
component: true
links:
doc: https://react-aria.adobe.com/Calendar
api: https://react-aria.adobe.com/Calendar#api
---
## Installation
Command
Manual
```bash
npx shadcn@latest add calendar
```
Install the following dependencies:
```bash
npm install react-aria-components @internationalized/date
```
Add the `Button` component to your project.
The `Calendar` component uses the `Button` component. Make sure you have it installed in your project.
Copy and paste the following code into your project.
Update the import paths to match your project setup.
## Usage
```tsx showLineNumbers
import {
getLocalTimeZone,
today,
type CalendarDate,
} from "@internationalized/date"
import { Calendar } from "@/components/ui/calendar"
```
```tsx showLineNumbers
const [date, setDate] = React.useState(
today(getLocalTimeZone())
)
return (
)
```
See the [React Aria](https://react-aria.adobe.com/Calendar) documentation for more information.
## Date Picker
You can use the `` component to build a date picker. See the [Date Picker](/docs/components/aria/date-picker) page for more information.
## International Calendars
To use international calendar systems such as Persian, Islamic, or Buddhist, use React Aria's `I18nProvider` to set the locale.
## Basic
A basic calendar component. We used `className="rounded-lg border"` to style the calendar.
## Range Calendar
Use the `RangeCalendar` component to enable range selection.
## Month and Year Selector
Use `captionLayout="dropdown"` to show month and year dropdowns.
## Presets
## Date and Time Picker
## Booked dates
## Custom Cell Size
You can customize the size of calendar cells using the `--cell-size` CSS variable. You can also make it responsive by using breakpoint-specific values:
```tsx showLineNumbers
```
Or use fixed values:
```tsx showLineNumbers
```
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
See also the [International Calendars Guide](#international-calendars) for enabling the international calendars such as Persian / Hijri / Jalali.
## API Reference
See the [React Aria](https://react-aria.adobe.com/Calendar) documentation for more information on the `Calendar` component.