MonthCalendar
My leave and holidays over one month.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/month-calendar.jsonMonth with marks
Desember 2026
When to use
- The side card on Cuti saya (employee): one person, one month.
- Showing which days are already off (weekend, holiday) before the user asks for leave.
When not to use
- Many people in one month (admin Cuti · Kalender) → the team calendar with chips per person.
- Picking dates in a form → DateField (its own popup calendar).
- A short list of upcoming dates → Card + date ListRows.
Do and don't
Show the days that are already freeGrey weekends and the holiday bar on 25 Des let the user see that 30–31 Des next to a weekend and Tahun Baru gives a long break.
Module colour as a status, red holiday cellsA Cuti-teal cell says "this is Cuti", not "approved": status cells use green / amber, as the badges do. A red fill reads as an error: holidays are grey like weekends with one small red bar. Weeks start on Senin.
Installation
Add MonthCalendar with the shadcn CLI (your project needs a components.json and the MaHR theme: https://mahrdesign.faizintifada.com/r/theme.json), or copy the files by hand.
API
import { MonthCalendar } from "@/components/mahr/month-calendar"| Prop | Type | Default | Description |
|---|---|---|---|
month · onMonthChange | Date | string · (month: Date) => void | this month | Controlled by the page; it fetches leave for that month. |
leave | { from, to, status: "approved" | "pending" }[] | [] | Rejected and cancelled requests are not passed. |
holidays | { date, name }[] | [] | Names go in the legend row ("Natal 25 Des"). |
today | Date | string | new Date() | Week starts Senin (fixed, not a prop). No module prop: leave cells use the status colours. |
title · note | string · string | – | Defaults: "Desember 2026" · "Cuti saya dan hari libur". |
error · onRetry | boolean · () => void | false | Failed load: the grid keeps its space (invisible), "Gagal dimuat." + secondary "Coba lagi" sit on it. Same height. |