Full-page monthly calendar with colored event pills and a view switcher.
Renders a Google Calendar-style month view:
- MON-first 7-column grid
- Days from adjacent months shown (muted)
- Today's cell highlighted with a primary-color ring
- Events as full-width colored pills:
"HH:MM (label)" - View switcher: Month / Week / Day / List (Week/Day/List stub — Month implemented)
Event format
events = [
%{date: ~D[2024-09-08], time: "9:00", label: "2 hours", color: "green"},
%{date: ~D[2024-09-11], time: "13:00", label: "info here", color: "orange"},
%{date: ~D[2024-09-11], time: "13:00", label: "info here", color: "orange"},
]Example
<.big_calendar
year={@year}
month={@month}
view={@view}
events={@events}
on_navigate="cal-nav"
on_view_change="cal-view"
on_day_click="cal-day"
on_event_click="cal-event"
/>LiveView event handlers
on_navigatereceives%{"direction" => "prev"|"next", "month" => m, "year" => y}on_view_changereceives%{"view" => "month"|"week"|"day"|"list"}on_day_clickreceives%{"date" => "YYYY-MM-DD"}on_event_clickreceives%{"date" => "YYYY-MM-DD", "time" => "HH:MM", "label" => "..."}
Summary
Functions
Renders a full-page monthly calendar with colored event pills.
Functions
Renders a full-page monthly calendar with colored event pills.
Example
<.big_calendar
year={2024}
month={9}
events={[%{date: ~D[2024-09-08], time: "9:00", label: "2 hours", color: "green"}]}
on_navigate="cal-nav"
on_view_change="cal-view"
on_day_click="cal-day"
on_event_click="cal-event"
/>Attributes
year(:integer) - Calendar year. Defaults to the current year. Defaults tonil.month(:integer) - Calendar month (1–12). Defaults to the current month. Defaults tonil.view(:string) - Active view. One of: month | week | day | list. Defaults to"month". Must be one of"month","week","day", or"list".events(:list) - List of event maps. Each map must have:date(Date.t()),:time(string). Optional:label(string) and:color("green"|"orange"|"blue"|"red"|"purple"|"gray"). Defaults to[].on_navigate(:string) - LiveView event name fired by prev/next buttons. Receives direction, month and year values. Defaults tonil.on_view_change(:string) - LiveView event name fired when a view button is clicked. Receives the view value. Defaults tonil.on_day_click(:string) - LiveView event name fired when a day cell is clicked. Receivesphx-value-date(ISO 8601). Defaults tonil.on_event_click(:string) - LiveView event name fired when an event pill is clicked. Receives date, time and label values. Defaults tonil.class(:string) - Additional CSS classes for the root element. Defaults tonil.- Global attributes are accepted. HTML attributes forwarded to the root
<div>element.