Calendar Component

A modern, sleek, and fully interactive calendar system built with ViewComponent, Stimulus, and Tailwind CSS.

📅

Month Navigation

Easily navigate between months with smooth transitions and keyboard support.

🎨

Color-Coded Events

Multiple event types with distinct colors for easy visual identification.

📱

Fully Responsive

Adapts beautifully to any screen size, from mobile to desktop.

Interactive Calendar

August 2026

Sun
Mon
Tue
Wed
Thu
Fri
Sat
26
27
28
29
30
31
1
2
📌 Past Event Done
1
3
4
👥 Team Meeting 10:00 AM
🍕 Lunch Break 12:00 PM
2
5
⚠️ Project Deadline 5:00 PM
1
6
💻 Code Review 2:00 PM
1
7
🚀 Release v2.0 9:00 AM
1
8
9
👥 Team Standup 9:30 AM
📞 Client Call 3:00 PM
2
10
11
📋 Sprint Planning 10:00 AM
1
12
13
14
🎉 Demo Day 2:00 PM
1
15
16
🎓 Workshop 1:00 PM
1
17
18
🏢 Company All-Hands 11:00 AM
1
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5

Event Types

Primary Events
Secondary Events
Accent Events
Success Events
Warning Events
Info Events

Multiple Calendars

Display multiple months side by side for better planning and overview.

August 2026

Sun
Mon
Tue
Wed
Thu
Fri
Sat
26
27
28
29
30
31
1
2
3
4
Today
1
5
6
7
8
9
👥 Meeting
1
10
11
12
13
14
⚠️ Deadline
1
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5

September 2026

Sun
Mon
Tue
Wed
Thu
Fri
Sat
30
31
1
2
3
4
🎯 Start of Month
1
5
6
7
8
9
10
11
🏁 Milestone
1
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3

Usage Example

Basic Usage

<%= render(CalendarComponent.new(
  year: Date.today.year,
  month: Date.today.month,
  show_controls: true,
  events: [
    { 
      id: 1, 
      date: Date.today, 
      title: "Team Meeting", 
      type: :primary, 
      icon: "👥", 
      time: "10:00 AM" 
    }
  ]
)) %>

Event Properties

id

Unique identifier for the event

date

Date object for when the event occurs

title

The event title/name

type

:primary, :secondary, :accent, :success, :warning, :info

icon

Optional emoji or icon character

time

Optional time string for the event

Component Options

year

Year to display (default: current year)

month

Month to display (default: current month)

show_controls

Show/hide navigation controls (default: true)

events

Array of event hashes to display

Interactive Features

Click to Select Days

Click any day to select it and trigger custom events

Month Navigation

Use arrow buttons to navigate between months

Event Hover Effects

Hover over events to see them highlighted

Custom Event Dispatching

Dispatches calendar:daySelected and calendar:monthChanged events

Responsive Design

Adapts to mobile, tablet, and desktop screens

Stimulus Integration

Listen to Calendar Events

// In your Stimulus controller
connect() {
  this.element.addEventListener('calendar:daySelected', (event) => {
    console.log('Selected date:', event.detail.date)
  })

  this.element.addEventListener('calendar:monthChanged', (event) => {
    console.log('Month changed:', event.detail.year, event.detail.month)
  })
}