Search

Search the site

All components

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
1"use client";
2
3import { useCallback } from "react";
4import {
5 MorphCalendar,
6 type MorphCalendarDayData,
7 type MorphCalendarEvent,
8} from "@/registry/ui/morph-calendar";
9
10export 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 ];
20
21 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 );
40
41 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}
49
50function formatDateKey(date: Date) {
51 return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
52}
53
54export function MorphCalendarDefaultExample() {
55 const getDayData = useCallback(
56 (date: Date) => generateMorphCalendarDemoData(date),
57 [],
58 );
59
60 const getActivityLevel = useCallback(
61 (date: Date) => (date.getDate() % 4) + 1,
62 [],
63 );
64
65 return (
66 <MorphCalendar
67 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

NameTypeDefaultDescription
getDayData(date: Date) => MorphCalendarDayDataRequiredReturns events, productivity %, task counts, and notes for the expanded day view
getActivityLevel(date: Date) => numberundefined (no dots)Optional 1–4 activity dots shown under each in-month day cell
defaultMonthDatenew Date()Initial month displayed in the grid
fromYearnumber100 years before todayEarliest year available in the year picker
toYearnumber10 years after todayLatest year available in the year picker
classNamestringundefinedAdditional classes on the root card container