Event Calendar

Month and week event calendar: month cells pack events into lanes so multi-day events become bars across the week row and overflowing days open a "+N more" list, while week view places timed events on an hour grid, side by side where they overlap, with a live now line and optional 15-minute drag to reschedule. Periods slide in from the direction you travel, the Month/Week switcher pill glides between views, and day cells support arrow-key navigation.

Preview

Event Calendar preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/event-calendar
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

events
CalendarEvent[]
—
date?
Date

Controlled visible period: any day inside the month or week shown.

—
defaultDate?
Date

Uncontrolled initial period. Default: today, read after mount.

—
onDateChange?
((date: Date) => void)
—
view?
"month" | "week"
—
defaultView?
"month" | "week"
month
onViewChange?
((view: EventCalendarView) => void)
—
onEventClick?
((event: CalendarEvent) => void)
—
onSlotClick?
((date: Date) => void)

An empty day (month view) or time slot (week view, 30-min precision) was clicked.

—
onEventChange?
((event: CalendarEvent, next: { start: Date; end: Date; }) => void)

Enables dragging timed events in week view (mouse and pen) in 15-minute steps, across days too. The calendar does not move the event itself: apply `next` to your `events`.

—
weekStartsOn?
0 | 1 | 2 | 3 | 4 | 5 | 6

0 = Sunday … 6 = Saturday. Default 0.

0
locale?
string

BCP 47 locale for dates and times. Default "en-US" — a fixed default keeps server and client output identical for hydration.

en-US
height?
number

Height of the calendar body below the toolbar, in px. Default 520.

520
maxEventsPerDay?
number

Most event rows per month cell (fewer if the cell is short). An overflowing day shows "+N more". Default 3.

3
className?
string
—
aria-label?
string
Event calendar

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.

Updated