Time Display Components

Show time information alongside event titles using custom event components

Interactive Demo

CustomEvent component - Shows time range with event title (all views)

Immediate updates - drag or resize events for instant changes

May 17 – 23
Team Building Event
12:00 AM
1:00 AM
2:00 AM
3:00 AM
4:00 AM
5:00 AM
6:00 AM
7:00 AM
8:00 AM
9:00 AM
10:00 AM
11:00 AM
12:00 PM
1:00 PM
2:00 PM
3:00 PM
4:00 PM
5:00 PM
6:00 PM
7:00 PM
8:00 PM
9:00 PM
10:00 PM
11:00 PM
9:00 AM – 9:30 AM
9:00 AM - 9:30 AM
Morning Standup
10:30 AM – 11:30 AM
10:30 AM - 11:30 AM
Design Review
12:00 PM – 1:00 PM
12:00 PM - 1:00 PM
Lunch with Team
2:00 PM – 3:30 PM
2:00 PM - 3:30 PM
Client Presentation
4:00 PM – 5:00 PM
4:00 PM - 5:00 PM
Code Review Session
10:00 AM – 11:00 AM
10:00 AM - 11:00 AM
Product Demo
1:30 PM – 3:00 PM
1:30 PM - 3:00 PM
Sprint Planning
9:30 AM – 10:00 AM
9:30 AM - 10:00 AM
One-on-One Meeting

Implementation Examples

Basic Usage - Single Component

Use the same custom event component for all calendar views.

calendar.tsx
import { CustomEvent } from "shadcn-big-calendar";

// Use for all views
<ShadcnBigCalendar
  localizer={localizer}
  events={events}
  components={{
    event: CustomEvent,
  }}
/>

View-Specific Components

Use different components optimized for each view type (month, week, day, agenda).

calendar.tsx
import {
  CustomMonthEvent,
  CustomWeekEvent,
  CustomAgendaEvent
} from "shadcn-big-calendar";

// Use different components per view
<ShadcnBigCalendar
  localizer={localizer}
  events={events}
  components={{
    month: { event: CustomMonthEvent },
    week: { event: CustomWeekEvent },
    day: { event: CustomWeekEvent },
    agenda: { event: CustomAgendaEvent },
  }}
/>

Custom Implementation

Create your own event component with custom time formatting and styling.

custom-event.tsx
import { CustomEvent } from "shadcn-big-calendar";
import type { EventProps } from "react-big-calendar";

// Create your own custom event component
function MyCustomEvent({ event }: EventProps) {
  const formatTime = (date: Date) => {
    return date.toLocaleTimeString([], {
      hour: "numeric",
      minute: "2-digit",
      hour12: true,
    });
  };

  return (
    <div className="flex flex-col gap-0.5">
      {!event.allDay && (
        <div className="text-[10px] font-medium opacity-90">
          {formatTime(event.start)} - {formatTime(event.end)}
        </div>
      )}
      <div className="text-xs font-medium truncate">
        {event.title}
      </div>
    </div>
  );
}

Available Components

CustomEvent

General-purpose event component that displays time range and title in a stacked layout. Works well across all calendar views.

CustomMonthEvent

Optimized for month view where space is limited. Shows start time inline with the title for better space utilization.

CustomWeekEvent

Optimized for week and day views with more vertical space. Displays time range and title stacked with enhanced readability.

CustomAgendaEvent

Designed for agenda view list format. Shows time range in a fixed-width column alongside the event title for consistent alignment.

Key Features

Time Formatting

Automatic 12-hour time format with AM/PM indicators. All-day events are handled gracefully.

Responsive Text

Text sizes are optimized for each view type to ensure readability at different zoom levels.

Truncation

Long event titles are truncated with ellipsis to prevent layout breaking in constrained spaces.

Theme Support

Works seamlessly with light and dark themes using Tailwind CSS and CSS variables.