Timeline view — horizontal time axis with resources as rows.
Used for resource scheduling (rooms, people, equipment), Gantt-style project views, and multi-resource booking.
Events are filtered to the rendered date and midnight-crossing events are
clamped to it (a 23:50 → 00:20 session renders as 23:50 → 24:00 on day one
and 00:00 → 00:20 on day two); both behaviors have opt-out attrs.
Summary
Functions
Renders a horizontal timeline with resource rows.
Functions
Renders a horizontal timeline with resource rows.
Attributes
date— The date to displayid— optional per-instance prefix for event DOM idsresources— List ofPhoenixLiveCalendar.Resourcestructsevents— List ofPhoenixLiveCalendar.Eventstructs (matched to a row viaresource_idor the pluralresource_ids)show_time_axis— render the sticky time header (defaulttrue; widgets turn it off)min_time— Earliest visible time (default:~T[00:00:00])max_time— Latest visible time (default:~T[23:59:59])slot_duration— Slot duration in minutes (default: 60)slot_width— CSS width per time slot (default: "5rem")resource_width— CSS width for the resource label column (default: "12rem")filter_to_date— Only render events that occupydate(default:true). Off = the caller pre-filters; every event ineventsrenders. Note thatclamp_to_datealso implies this filter — an event that never touches the date has an empty intersection with it, so there is nothing to drawclamp_to_date— Clamp each event's bar to the intersection of its span withdate, so midnight-crossing events position correctly on both days (default:true). Off = bars position by raw time-of-day (an event crossing midnight renders wrong — pre-0.2.0 behavior)sticky_resource_column— Keep the resource label column pinned during horizontal scroll (default:true)show_now_indicator— Vertical current-time line whendateis today and the current time falls inside the visible window (default:true, matching the day/week grids)today— Today's date, for the now indicator (default:Date.utc_today())now— Current wall-clock time for the now indicator (default:Time.utc_now()). Pass the viewer's local time when your events/todayare in the viewer's framefit_to_events— Compute the visible window from the rendered events instead ofmin_time/max_time: earliest start floored to the hour, latest end ceiled to the hour (default:false). Falls back tomin_time/max_timewhen no timed events render or when the computed window would be empty/invertedlabel_position— where bar labels go::fit(default) renders the label inside the bar when the server-side estimate says it fits, else falls back perlabel_fit_fallback;:insidealways in-bar (truncated);:outsidealways beside the bar;:noneno labels (tooltip + aria still identify every bar)label_fit_ratio— how much of the estimated label must fit for:fitto choose inside (default0.75)label_fit_fallback—:outside(default) or:none; outside labels place after the bar, flip before it at the track edge, and suppress themselves rather than overprint a neighbouring bar or labelon_event_click— Handler for event clickson_slot_click— Handler for time slot clickstranslations— Translation overridestime_format—:h24or:h12(default::h24)class— Additional CSS classesdir— Text direction (default::ltr)
Slots
event— Custom event renderingresource_label— Custom resource label. Receives the resource.
All-day events covering date render as full-width bars.
Attributes
date(Date) (required)id(:string) - Optional prefix for generated event DOM ids. Set it when two views on one page can render the SAME events — without it their per-event ids collide. Defaults tonil.resources(:list) (required)events(:list) - Defaults to[].min_time(Time) - Defaults to~T[00:00:00].max_time(Time) - Defaults to~T[23:59:59].slot_duration(:integer) - Defaults to60.slot_width(:string) - Defaults to"5rem".resource_width(:string) - Defaults to"12rem".filter_to_date(:boolean) - Defaults totrue.clamp_to_date(:boolean) - Defaults totrue.sticky_resource_column(:boolean) - Defaults totrue.show_time_axis(:boolean) - Defaults totrue.show_now_indicator(:boolean) - Defaults totrue.today(:any) - Date | nil (server today) | :none (no today highlight). Defaults tonil.now(Time) - Defaults tonil.fit_to_events(:boolean) - Defaults tofalse.label_position(:atom) - Defaults to:fit. Must be one of:none,:inside,:outside, or:fit.label_fit_ratio(:float) - Defaults to0.75.label_fit_fallback(:atom) - Defaults to:outside. Must be one of:outside, or:none.on_event_click(:any) - Defaults tonil.on_slot_click(:any) - Defaults tonil.translations(:map) - Defaults to%{}.time_format(:atom) - Defaults to:h24.class(:string) - Defaults to"".dir(:atom) - Defaults to:ltr.
Slots
eventresource_label