Calendar components for a-h/templ. Copy the source into your project and bring your own Tailwind build.
go run github.com/codypotter/templ-calendar/cmd/templ-calendar@latest add all ./components/calendar templ generate
Click the violet event to see an HTMX interaction. Click "Lunch with design" or "Retro" to see Alpine popovers.
@calendar.Calendar(calendar.Props{
Year: 2026,
Month: time.June,
Location: time.Local,
HideHeading: false,
Events: []calendar.Event{
{
ID: "1",
Title: "Sprint review",
Start: time.Date(2026, time.June, 15, 14, 0, 0, 0, time.Local),
End: time.Date(2026, time.June, 17, 15, 0, 0, 0, time.Local),
},
},
})@calendar.Navigator(calendar.NavigatorProps{
Year: 2026,
Month: time.June,
PrevAttributes: templ.Attributes{
"hx-get": "/?year=2026&month=5",
"hx-target": "#calendar-container",
"hx-select": "#calendar-container",
"hx-swap": "outerHTML",
},
NextAttributes: templ.Attributes{
"hx-get": "/?year=2026&month=7",
"hx-target": "#calendar-container",
"hx-select": "#calendar-container",
"hx-swap": "outerHTML",
},
})@calendar.Jumper(calendar.JumperProps{
Year: 2026,
Month: time.June,
FormAttributes: templ.Attributes{
"hx-get": "/",
"hx-target": "#calendar-container",
"hx-select": "#calendar-container",
"hx-swap": "outerHTML",
"hx-trigger": "change",
},
})