# CalendarStrip (/docs/charts/calendar-strip)

CalendarStrip answers "what did the last few weeks actually look like, day by day?" — week-aligned recent activity where
real calendar position matters. Weekday rhythm is the read; for longer ordinal histories, use ActivityGrid.

```tsx
<CalendarStrip
  data={Array.from({ length: 18 }, (_, i) => ({
    date: `2026-06-${String(4 + i).padStart(2, "0")}`,
    value: i % 4 === 3 ? 0 : (i % 7) + 1,
  }))}
  end="2026-07-01"
  title="Deploy cadence"
  style={{ width: 150, height: 84 }}
/>
```

## Install

```tsx
import { CalendarStrip } from "@microcharts/react/calendar-strip";

<CalendarStrip data={days} end="2026-07-01" title="Deploy cadence" />
```

Setup (package + stylesheet): [Quickstart](/docs/quickstart#set-up-with-an-ai-agent) or paste [`/agent-setup.md`](/agent-setup.md) into your agent.


## When to use it

- **Good for** — habit/deploy cadence in KPI cards, week-aligned recent activity.
- **Avoid for** — long ordinal histories (ActivityGrid), exact per-day values (MiniBar).


## Variants

```tsx
<CalendarStrip data={days} end="2026-07-01" weeks={2} />
```

```tsx
<CalendarStrip data={days} end="2026-07-01" weekStart={0} />
```

`cell`/`gap` bump the edge length and spacing directly — grid-sibling parity with ActivityGrid and GardenGrid.

```tsx
<CalendarStrip data={days} end="2026-07-01" cell={10} gap={2} />
```

## Edge cases

```tsx
<CalendarStrip data={[]} end="2026-07-01" />
```

```tsx
<CalendarStrip data={days} end="2026-07-01" weeks={2} />
```


## Why this default

Monday start + 4 weeks: one glance covers a month of weekday rhythm without scrolling history. All date math is UTC —
the same input renders identically in any host timezone, so SSR output never depends on where the server runs. `end`
defaults to today but should be pinned wherever determinism matters.

Empty ≠ zero: a day with no record renders as a faint outline, a day with value 0 as a filled track cell — a feed gap
never masquerades as a quiet day. Future days are blank, never extrapolated.

## Accessibility

The accessible name counts real days — **"Active 11 of 24 days over 4 weeks."** The interactive entry walks the grid in
2-D and announces real calendar days (**"Thursday, June 11: 0."**, **"Tuesday, June 23: no data."**).

The interactive entry follows the shared [interaction contract](/docs/accessibility#one-interaction-contract):
arrow keys rove between units on both axes, `Home` and `End` jump to the ends, and a click, tap, `Enter` or
`Space` selects a unit — pinning its readout so it survives blur, until you select it again or press `Escape`.
On touch, a tap pins and a drag scrubs.

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `data` (required) | `{ date; value }[]` | Date-keyed values; duplicates sum with a dev warning. |
| `weeks` | `number` | Window length in whole weeks ending at `end` (default 4). |
| `end` | `string \| Date` | Last day of the window (defaults to today UTC — pin it for SSR determinism). |
| `weekStart` | `0 \| 1` | Locale start-of-week (default Monday). |
| `steps` | `number` | Intensity steps including the zero track (default 5). |
| `shape` | `"square" \| "round" \| "dot"` | Shared cell vocabulary. |
| `cell` | `number` | Cell edge length in viewBox units (default 7). |
| `gap` | `number` | Gap between cells (default 1). |
| `dateFormat` | `Intl.DateTimeFormatOptions \| (d: Date) => string` | (interactive) Announced day label (defaults to weekday + month + day, UTC). |
| `animate` | `boolean` | (interactive) Opt-in entrance motion when the chart mounts client-side — add `import "@microcharts/react/motion"` once. Inert on the server, on hydrated server HTML, and under `prefers-reduced-motion`. |

Plus the shared grammar — `data`, `domain`, `color`, `title`, `summary`, `format` — and the layout props (`width`, `height`, `className`, `style`) that every chart accepts. Interactive entries also share `animate` and `live`, and — wherever a chart has more than one navigable unit — `onActive`, `onSelect`, `selectedIndex` and `defaultSelectedIndex`; and — wherever the chart shows a hover value — `readout`. See [the shared grammar](/docs/quickstart#the-shared-grammar).
