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

November 2026

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

November 2026

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

December 2026

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

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)
  })
}