# Calendar

A month to pick a date or a range from, in the page's locale and week start. Built on ui-sdk's Calendar: arrow keys move between days, Page Up and Down between months, and the month and year are dropdowns (native selects on touch screens). Each day is a 32 px cell with a 28 px circle. Paging slides the new month in from the side you went toward while the old one crossfades out, and the grid eases between five- and six-week months instead of jumping; with reduced motion it only crossfades.

- Beta: ready to use; its API can still change in a minor release.
- Category: Form fields

```tsx
import { Calendar } from "@leap-crm/design-system";
```

## Best practices

- Do: Use it on its own where the month is the content, like a panel for choosing an appointment day. For a date in a form, use `DatePicker`, which opens this month from a field.
- Do: Set `min`, `max` and `unavailable` to disable the days that can't be chosen, like weekends for a court date or days before the instruction date.
- Do: Use `mode="range"` when the span is picked on the month itself, like a lawyer's leave. In a form, use `DateRangePicker`.
- Don't: Use it for a date of birth or another date far in the past. Use `DateInput`: typing is faster than paging back decades.
- Don't: Build a date field from `CalendarMonth` in your own popover. Use `DatePicker`, which opens the same month from a field.

## Keyboard

| Keys | What they do |
| --- | --- |
| Arrow keys | Move focus by day and by week. |
| Page Up, Page Down | Move by month, and with Shift by year. |
| Home, End | Go to the first and last day of the week. |
| Enter, Space | Select the focused day. |
| Escape | In range mode, drops a start that has no end yet. |
| Tab | Leaves the grid after one stop. |

## Related

- [Date Picker](./date-picker.md)
- [Date Input](./date-input.md)

## Examples

What the examples import:

```tsx
import { useState } from "react";
import { Calendar } from "@leap-crm/design-system";
```

Scaffolding the examples call. It lives in the docs page, not in the library:

```tsx
function SingleDemo() {
  const [value, setValue] = useState<string | null>("2026-11-14");
  return (
    <div className="flex flex-col gap-3">
      <Calendar
        value={value}
        onValueChange={next => setValue(typeof next === "string" ? next : null)}
        defaultMonth="2026-11"
        today="2026-11-22"
      />
      <span className="text-small text-neutral-text-muted">
        Selected: {value ?? "none"}
      </span>
    </div>
  );
}
```

### One date

Today is ringed, the selected day fills navy, days outside the month are muted. Tab into the grid and use the arrows to see the focus ring.

```tsx
<SingleDemo />
```

### Range

Pick a start and an end: the days between take the navy-100 band, the ends fill navy.

```tsx
<Calendar
  mode="range"
  defaultValue={["2026-11-10", "2026-11-18"]}
  defaultMonth="2026-11"
  today="2026-11-22"
/>
```

### Limits

min and max disable the days outside them; weekends are unavailable here.

```tsx
<Calendar
  defaultMonth="2026-11"
  min="2026-11-05"
  max="2026-11-25"
  unavailable={date =>
    [0, 6].includes(new Date(`${date}T00:00`).getDay())
  }
  today="2026-11-22"
/>
```

## Props

Also takes ui-sdk's Calendar options: mode (single or range), value, defaultValue, onValueChange, month, defaultMonth, min, max, unavailable, disabled, readOnly, locale, weekStartsOn and today.

### Calendar

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  | Classes added to the root element, merged with its own. Tokens only. |
| `weekdayFormat` | `unknown` | `"narrow"` |  |

### CalendarMonth

No props of its own.
