Events down a line, each marked by a filled, outlined, icon or avatar point.
<.timeline marker="icon" size="lg">
<.timeline_item title="NF-e autorizada" description="Protocolo 129 2611" time="14:02" color="success">
<:point><.icon name="check" size="sm" /></:point>
</.timeline_item>
</.timeline>The items can come from a list or a stream through rows and the :item slot, which gets
{dom_id, row} (given a stream, the list renders with phx-update="stream" and needs an id):
<.timeline id="events" rows={@streams.events}>
<:item :let={{id, event}}>
<.timeline_item id={id} title={event.title} time={event.ago} color={event.color} />
</:item>
</.timeline>variant="canvas" is a list of timeline_events, each with a boxed icon tile, a title over a
subtitle and the time at the right.
Styling note: the marker look (solid, outline, icon, avatar, dot) is a class of the
whole line in the stylesheet, so it is set on the timeline with marker; the item's variant
only decides what its point holds.
Summary
Functions
Attributes
line_space(:boolean) - Leaves a gap between the points and the line. Defaults tofalse.size(:string) - Defaults to"md". Must be one of"md","lg","xl", or"2xl".density(:string) - Defaults to"default". Must be one of"default", or"compact".variant(:string) - Defaults to"line". Must be one of"line", or"canvas".marker(:string) - The look of the points of alinetimeline. Defaults to"solid". Must be one of"solid","outline","icon","avatar", or"dot".items(:list) - Points as data, before the inner block: maps with:titleand optionally:time,:description,:color,:variant(solid,outline,icon,avatar) and:ping, onetimeline_item/1each. Defaults to[].id(:string) - Required with a stream. Defaults tonil.rows(:any) - A list or a stream of rows rendered by the:itemslot. Defaults tonil.row_id(:any) - A function from a row to its DOM id, for a plain list. Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_blockitem- Renders one row; gets{dom_id, row}.
Attributes
label(:string) (required)class(:any) - Defaults tonil.- Global attributes are accepted.
Attributes
title(:string) - Defaults tonil.subtitle(:string) - Defaults tonil.time(:string) - Defaults tonil.tone(:string) - Defaults to"default". Must be one of"acc","default","info","neg","pos", or"warn".class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
icon- The icon inside the tile.inner_block- Free content after the title and the subtitle.
Attributes
title(:string) - Defaults tonil.time(:string) - Defaults tonil.description(:string) - Defaults tonil.color(:string) - Defaults to"neutral". Must be one of"accent","dark","error","info","neutral","primary","secondary","success", or"warning".variant(:string) - Defaults to"solid". Must be one of"solid","outline","icon", or"avatar".point_class(:any) - Defaults tonil.ping(:boolean) - Defaults tofalse.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
details- The description with markup; replacesdescription.inner_blockpoint- What the point shows, usually an icon.