HammerHammer

Calendar

A schedule calendar with month / week / day views and event editing.

Open in v0

Last updated:04/10/2026, 05:17:37

Open preview in new tab

Installation

npm install @chaos-design/calendar

Usage

import "@chaos-design/calendar/dist/es/index.css";
import { Calendar } from "@chaos-design/calendar";

const initialDate = new Date();

export default function Demo() {
  return (
    <Calendar
      initialDate={initialDate}
      locale="en"
      defaultView="month"
      events={[
        {
          id: "1",
          title: "Daily standup",
          start: new Date(2026, 0, 31, 10, 0),
          end: new Date(2026, 0, 31, 10, 30),
          color: "bg-red-600",
          allDay: true,
        },
      ]}
    />
  );
}

Using with shadcn/ui

  1. Install the dependency
npm install @chaos-design/calendar
  1. Import the calendar styles in your global stylesheet
@import "@chaos-design/calendar/dist/es/index.css";
  1. Use the component
import { Calendar } from "@chaos-design/calendar";

export default function Demo() {
  return <Calendar defaultView="month" locale="en" />;
}

Props

PropTypeDefaultDescription
classNamestring-Custom class name.
classNamesCalendarClassNames-Custom class names for internal elements.
eventsCalendarEvent[]-Controlled list of events.
defaultEventsCalendarEvent[][]Initial (uncontrolled) list of events.
defaultView"month" | "week" | "day""month"Initial view.
weekStart"sunday" | "monday""monday"First day of the week.
initialDateDatenew Date()Initial focused date.
onEventCreate(event: CalendarEvent) => void-Callback on event creation.
onEventUpdate(event: CalendarEvent) => void-Callback on event update.
onEventDelete(id: string) => void-Callback on event deletion.
theme"light" | "dark""light"Theme mode.
onThemeToggle(next: "light" | "dark") => void-Callback on theme toggle.
categoriesCalendarCategory[]DEFAULT_CATEGORIESList of categories.
locale"en" | "zh""en"Language.
onLocaleChange(next: "en" | "zh") => void-Callback on language toggle.
themeConfigThemeConfigDEFAULT_THEMETheme configuration overrides.

CalendarEvent

PropTypeDescription
idstringUnique event id.
titlestringEvent title.
startDateStart time.
endDateEnd time.
colorstringEvent colour (Tailwind class or Hex).
allDaybooleanWhether the event spans the whole day.
descriptionstringEvent description (optional).
categorystringEvent category id (optional).

CalendarClassNames

PropTypeDescription
containerstringRoot container.
headerstringHeader area.
monthViewstringMonth view container.
weekViewstringWeek view container.
dayViewstringDay view container.
eventModalstringEvent modal.
eventPopoverstringEvent popover.
inlineEditorstringInline editor.

On this page