Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Event Calendar

ProNew

Supplied events as a date-led list, photo grid, masonry wall, scrollable slider, month grid or week schedule, with category filters, details and .ics download.

Installation

pnpm dlx shadcn@latest add @viewport/event-calendar

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
events*CalendarEvent[]—
layout"list" | "cards" | "masonry" | "slider" | "month" | "week"

`list` is date-led rows; `cards`, `masonry` and `slider` show event cards; `month` and `week` are calendars.

"list"
titlestring

Heading above the calendar.

—
categoriesEventCategory[]

Names and colors of the categories, in filter order. Defaults to the ones found in `events`.

—
filterboolean

Shows the category filter.

true
weekStart0 | 1

First day of the week: 0 is Sunday, 1 is Monday.

0
hour12boolean

12-hour times with AM and PM.

true
localestring"en-US"
defaultDatestring

Day the `month` and `week` layouts open on, as `2026-11-24`. Defaults to today.

—
nowstring | Date

Overrides the current time, for tests and screenshots.

—
loadingboolean

Shows placeholders while the events load.

false
onAddToCalendar(event: CalendarEvent) => void

Replaces the built-in .ics download behind “Add to Calendar”.

—
classNamestring—

Accessibility

  • Every event is a button named with its title, date and time; it opens a dialog that traps focus and returns it on close.
  • The month is a real table with weekday headers. On small screens each day is a toggle button that says how many events it has, and that day's events are listed below.
  • The week and slider scroll inside their own focusable regions, so the page never does; the slider supports arrow keys and named previous/next buttons.
  • Category chips are toggle buttons and never rely on color alone. The details panel and backdrop enter together; no fades, rises or zoom under reduced motion.
  • Action/directions URLs accept safe schemes only; a bad directions target falls back to a map search.