# Calendar

> Month calendar built on react-day-picker.

Registry name: `calendar`. HTML docs: https://ui.anuragroy.dev/component/calendar.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/calendar.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/calendar.json`.

Registry JSON: https://ui.anuragroy.dev/r/calendar.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/calendar.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

```tsx
import { Calendar } from "@/components/ui/calendar"
```

## Usage

```tsx
import { Calendar } from "@/components/ui/calendar"

export function Example() {
  return <Calendar />
}
```

## API

### Calendar

Forwards `DayPicker` props (`mode`, `selected`, `onSelect`, …).

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `showOutsideDays` | boolean | true |  |
| `mode` | "single" \| "multiple" \| "range" | — |  |
| `selected` | Date \| Date[] \| DateRange | — |  |
| `onSelect` | (date) => void | — |  |

## Notes

- Depends on `react-day-picker` and `date-fns`.

## See also

- [HTML page](https://ui.anuragroy.dev/component/calendar): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/calendar.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
