---
title: "Shadcn Cash Calendar"
description: "A month calendar for sales teams. Free shadcn/ui Cash Calendar component for React, Next.js and Tailwind CSS."
url: https://avaraui.com/docs/nextjs/cash-calendar
---

# Shadcn Cash Calendar

A month calendar for sales teams. Every day totals the **sales** and **dues** logged against it, a rail adds up each week, and a click on a day opens who is behind the number.

## Installation

Add the component by URL — no setup needed:

```bash
npx shadcn@latest add https://avaraui.com/r/cash-calendar.json
```

Or register the @avara-ui registry once per project and add it by name:

```bash
npx shadcn@latest registry add @avara-ui=https://avaraui.com/r/{name}.json
npx shadcn@latest add @avara-ui/cash-calendar
```

## Cash calendar

Click a day to see its entries, or the plus to add one. Click an entry to edit it.

- Seed `defaultEntries` with one entry per payment: a `"YYYY-MM-DD"` date, a type of `"sales"` or `"due"`, a customer and an amount.
- `users` lists the customers the form suggests as you type, each with an optional photo.
- `onEntriesChange` receives the full list after every add, edit or remove, so you can save it.

```tsx
import { CashCalendar, type CashEntry, type CashUser } from "@/components/custom/blocks/CashCalendar";

// Customers the entry form can suggest. `avatar` is optional: without one the customer shows as initials.
const users: CashUser[] = [
  { name: "Cobalt Freight", avatar: "/faces/tom.jpg" },
  { name: "Kestrel Foods", avatar: "/faces/ana.jpg" },
];

// One entry per payment event. `date` is the local day as YYYY-MM-DD.
const entries: CashEntry[] = [
  { id: "1", date: "2026-12-15", type: "sales", party: "Cobalt Freight", amount: 22000, avatar: "/faces/tom.jpg" },
  { id: "2", date: "2026-12-15", type: "due", party: "Kestrel Foods", amount: 8200, note: "Net 30", avatar: "/faces/ana.jpg" },
];

export default function SalesCalendar() {
  return (
    <CashCalendar
      users={users}
      defaultEntries={entries}
      onEntriesChange={(next) => console.log("save", next)}
    />
  );
}
```

## Currency and week start

- Set `currency="EUR"` and `locale` to format every amount and date for another market.
- `weekStartsOn` is `1` for Monday (the default) or `0` for Sunday.

```tsx
import { CashCalendar } from "@/components/custom/blocks/CashCalendar";

export default function EuroCalendar({ entries }) {
  return (
    <CashCalendar
      currency="EUR"
      locale="de-DE"
      weekStartsOn={1}
      defaultEntries={entries}
    />
  );
}
```

## About Shadcn Cash Calendar

**What it is.** `CashCalendar` shows where money lands across a month. Each day tile lists its sales and its dues, each behind a green or red dot, with the faces of the customers behind them. A day of only sales is soft green, only dues soft red, and a mixed day blends the two in the ratio of the amounts. Empty days are light gray and the busiest day is filled orange. A switch above the grid narrows everything to sales or dues.

**Sales and dues.** A **sale** is money billed and collected. A **due** is a balance still to be collected. The sidebar totals the month in a dot-matrix figure with a bar per week, then lists the customers behind sales or dues on a tab, four at a time (three on a phone) with a "View +n more" button for the rest.

**Adding entries.** The entry form is a short modal with no labels: the fields name themselves. The day comes from a [Date Picker](https://avaraui.com/docs/nextjs/date-picker), and "Add entry" in the header opens it. Customer and note suggestions appear once you start typing. A new customer starts with a drawn male face; click it to pick the female face or add an image. The note stays hidden behind an "Add a note" button. The amount is a plain number like `50000`, which the calendar shows as `50k`, `1.25m` or `2b`, with at most two decimals and a trailing `…` when digits were cut.

**How it is built.** It is a client component that needs only the [Date Picker](https://avaraui.com/docs/nextjs/date-picker) and the shared animated icons. Its tabs and Today control match the [Calendar](https://avaraui.com/docs/nextjs/calendar). Entries live in its own state, seeded once from `defaultEntries`. The layout follows the width of its own container, so the sidebar sits beside the grid when there is room and becomes a drawer behind a menu button on a phone.

**When to use it.** Use it for a sales, invoicing or collections view. To schedule meetings and events, use [Calendar](https://avaraui.com/docs/nextjs/calendar).

## For AI agents

**When to use**

- A month view of sales and dues per day, with weekly totals, customer faces, a day detail popover and an add and edit form

**When not to use**

- Scheduling meetings or events: use [Calendar](https://avaraui.com/docs/nextjs/calendar)
- Picking a date in a form: use [Date Picker](https://avaraui.com/docs/nextjs/date-picker)

**Agent notes**

- Named export: `import { CashCalendar } from "@/components/custom/blocks/CashCalendar"`; it is also the default export
- Entries are `{ id, date, type, party, amount, note?, avatar? }`. `date` is a zero-padded local `"YYYY-MM-DD"`, `type` is `"sales" | "due"` and `amount` is a plain number in major units (`1200`, not cents)
- `defaultEntries` only seeds the first render. Added, edited and removed entries live in component state and are reported through `onEntriesChange`. Keep the seed array outside the component or memoised
- `users` is a list of `{ name, avatar? }` the form suggests. Customers already in the entries are suggested too, so `users` only needs the ones with no entry yet. Photos are URLs or data URLs; an uploaded photo is shrunk to 160px and kept as a data URL
- Amounts and dates are formatted with `Intl`, using `currency` (ISO 4217) and `locale`. The dot-matrix total draws `$`, `€` and `£` as symbols and leaves any other symbol out of the dots. Pass `today` (a `Date` or `"YYYY-MM-DD"`) when server and client may disagree about the date. Buttons are black in light mode and white in dark mode until `color` is set to any CSS colour
- The figure on a tile is the sum of sales and dues for that day, not net cash
- It sizes itself from its container: the sidebar sits beside the grid from about 900px wide and is a drawer below that. Set it on a stone ground such as `bg-[#F5F5F4]` so the white cards' shadows read
- The entry form renders into `document.body` so it covers the page

## Props Reference

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultEntries` | `CashEntry[]` | `[]` | The entries to start with. |
| `users` | `CashUser[]` | `[]` | Customers the entry form suggests, besides those already in the entries. |
| `onEntriesChange` | `(entries: CashEntry[]) => void` | `undefined` | Called with the full list after an entry is added, edited or removed. |
| `currency` | `string` | `"USD"` | ISO 4217 code used for every amount. |
| `locale` | `string` | `"en-US"` | BCP 47 locale for dates and amounts. |
| `weekStartsOn` | `0 \| 1` | `1` | First column of the grid: Monday (1) or Sunday (0). |
| `today` | `Date \| string` | the current day | Treats this day as today. Pass it for stable server and test output. |
| `color` | `string` | `"default"` | Fill of the Add entry button and the form's buttons. The default is black in light mode and white in dark mode; pass any CSS colour to change it. |
| `title` | `string` | `"Cash calendar"` | The accessible name of the calendar. It is not shown. |
| `className` | `string` | `undefined` | Extra classes for the outer element. |

## Works with other components

- Use [Calendar](https://avaraui.com/docs/nextjs/calendar) for meetings and events rather than money.
- Use [Chart](https://avaraui.com/docs/nextjs/chart) beside it for a trend over several months.

## What do sales and due mean in CashCalendar?

A `sales` entry is an amount billed to a customer and collected. A `due` is a balance still to be collected. The component adds them up by type and by day. It does not match a due against the sale it belongs to.

## Where do entries added in CashCalendar get saved?

Nowhere on their own. Entries live in React state, seeded from `defaultEntries`. Save them from `onEntriesChange`, which receives the full list after every add, edit or remove, and pass the loaded list back as `defaultEntries` on the next visit.

## Can customers have photos in CashCalendar?

Yes. Give a `CashUser` or a `CashEntry` an `avatar` URL and the customer shows that photo on the tiles, in the day popover and in the form. Without one they show as coloured initials. In the form a new customer starts with a drawn face, which can be swapped for the female face or an uploaded photo.

## Why does CashCalendar show a different day on the server and the client?

By default it reads the current day from the clock when it renders, and a server in another time zone can land on a different day. Pass `today` with the date you want, for example `today="2026-12-01"`, and both sides agree.

---

Live previews and every example: https://avaraui.com/docs/nextjs/cash-calendar
