Morph Calendar
Animated month grid that morphs into a day detail panel with timeline events, productivity ring, and task stats. Click the month or year in the header to open quick pickers.
Default
Click any day to morph into the detail view. Click the month or year label to jump via picker grids.
Sun
Mon
Tue
Wed
Thu
Fri
Sat
default-example.tsx
1"use client";23import { useCallback } from "react";4import {5 MorphCalendar,6 type MorphCalendarDayData,7 type MorphCalendarEvent,8} from "@/registry/ui/morph-calendar";910export function generateMorphCalendarDemoData(11 date: Date,12): MorphCalendarDayData {13 const seed = date.getDate() + date.getMonth() * 31;14 const eventTypes: MorphCalendarEvent["type"][] = [15 "meeting",16 "task",17 "reminder",18 "focus",19 ];2021 const events: MorphCalendarEvent[] = Array.from(22 { length: 2 + (seed % 4) },23 (_, i) => ({24 id: `event-${formatDateKey(date)}-${i}`,25 title: [26 "Team standup",27 "Design review",28 "Client call",29 "Focus time",30 "Project planning",31 "Code review",32 "1:1 meeting",33 "Workshop",34 ][((seed + i) * 7) % 8],35 time: `${9 + ((seed + i) % 8)}:${i % 2 === 0 ? "00" : "30"}`,36 type: eventTypes[(seed + i) % 4],37 completed: i < 2,38 }),39 );4041 return {42 events,43 productivity: 60 + (seed % 35),44 tasks: 4 + (seed % 5),45 completed: 2 + (seed % 3),46 notes: "Remember to follow up on the design feedback.",47 };48}4950function formatDateKey(date: Date) {51 return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;52}5354export function MorphCalendarDefaultExample() {55 const getDayData = useCallback(56 (date: Date) => generateMorphCalendarDemoData(date),57 [],58 );5960 const getActivityLevel = useCallback(61 (date: Date) => (date.getDate() % 4) + 1,62 [],63 );6465 return (66 <MorphCalendar67 getDayData={getDayData}68 getActivityLevel={getActivityLevel}69 />70 );71}
Installation & source
Install via the shadcn CLI or copy the registry files manually.
bash
npx shadcn@latest add @tt-ui/morph-calendar
Props
| Name | Type | Default | Description |
|---|---|---|---|
| getDayData | (date: Date) => MorphCalendarDayData | Required | Returns events, productivity %, task counts, and notes for the expanded day view |
| getActivityLevel | (date: Date) => number | undefined (no dots) | Optional 1–4 activity dots shown under each in-month day cell |
| defaultMonth | Date | new Date() | Initial month displayed in the grid |
| fromYear | number | 100 years before today | Earliest year available in the year picker |
| toYear | number | 10 years after today | Latest year available in the year picker |
| className | string | undefined | Additional classes on the root card container |