Avara UI

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.

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, 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 and the shared animated icons. Its tabs and Today control match the 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.

For AI agents

Hand your agent this brief or the Markdown page, not a screenshot.

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

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
Install
npx shadcn@latest add https://avaraui.com/r/cash-calendar.json
Registry name
@avara-ui/cash-calendar, through the shadcn MCP server
Index
llms.txt lists every page, or add the agent skill once

Props Reference

PropTypeDefaultDescription
defaultEntriesCashEntry[][]The entries to start with.
usersCashUser[][]Customers the entry form suggests, besides those already in the entries.
onEntriesChange(entries: CashEntry[]) => voidundefinedCalled with the full list after an entry is added, edited or removed.
currencystring"USD"ISO 4217 code used for every amount.
localestring"en-US"BCP 47 locale for dates and amounts.
weekStartsOn0 | 11First column of the grid: Monday (1) or Sunday (0).
todayDate | stringthe current dayTreats this day as today. Pass it for stable server and test output.
colorstring"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.
titlestring"Cash calendar"The accessible name of the calendar. It is not shown.
classNamestringundefinedExtra classes for the outer element.

Works with other components

  • Use Calendar for meetings and events rather than money.
  • Use 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.