Week-view calendar (Google Calendar style) with hourly time slots.
Renders a 7-column grid (Mon–Sun) with time rows and absolutely-positioned
event blocks. Events are placed by start/end time using CSS top/height
percentages computed server-side.
Zero JavaScript — pure HTML + inline style positioning.
Examples
<.gantt_chart week_start={@week_start}>
<:event
day={~D[2026-03-09]}
start_time="10:00"
end_time="11:30"
label="Team Meeting"
color="bg-blue-500"
/>
<:event
day={~D[2026-03-11]}
start_time="14:00"
end_time="15:00"
label="Design Review"
color="bg-purple-500"
/>
</.gantt_chart>
Summary
Functions
Attributes
week_start(:any) (required) - TheDatefor Monday of the displayed week.start_hour(:integer) - First visible hour (0–23). Default:8(8am). Defaults to8.end_hour(:integer) - Last visible hour, exclusive (0–23). Default:20(8pm). Defaults to20.id(:string) - Unique ID for the chart (auto-generated if not provided). Defaults tonil.title(:string) - Chart title rendered above the visualization. Defaults tonil.description(:string) - Chart description for context (rendered below title). 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.
Slots
event- An event block to render on the calendar. Accepts attributes:day(:any) (required) -Dateof the event.start_time(:string) (required) - Start time as"HH:MM".end_time(:string) (required) - End time as"HH:MM".label(:string) - Event title text.color(:string) - Tailwind bg class (e.g."bg-blue-500"). Default:bg-blue-500.