Timeline
A sequence of dated events as an ordered list.
Installation
Included in poetry-ui — available as
poetry_timeline
the moment you've installed Poetry,
with no per-component step. To own the source and edit it, copy it into your app:
bin/rails g poetry:add timeline
Default
Open Default standalone
- Order placedPayment authorized and inventory reserved.
- PackedTwo parcels sealed at dock B.
- In transitHanded to the carrier - estimated delivery Thursday.
- Delivered
<%= poetry_timeline(class: "max-w-md") do |timeline| %>
<% timeline.with_item(title: "Order placed", time: "Mar 15, 09:12", completed: true) do %>
Payment authorized and inventory reserved.
<% end %>
<% timeline.with_item(title: "Packed", time: "Mar 15, 14:03", completed: true) do %>
Two parcels sealed at dock B.
<% end %>
<% timeline.with_item(title: "In transit", time: "Mar 16") do %>
Handed to the carrier - estimated delivery Thursday.
<% end %>
<% timeline.with_item(title: "Delivered") %>
<% end %>
Horizontal
Open Horizontal standalone
- Ordered
- Packed
- Shipped
- Delivered
<%= poetry_timeline(orientation: :horizontal) do |timeline| %>
<% timeline.with_item(title: "Ordered", time: "Mar 15", completed: true) %>
<% timeline.with_item(title: "Packed", time: "Mar 15", completed: true) %>
<% timeline.with_item(title: "Shipped", time: "Mar 16") %>
<% timeline.with_item(title: "Delivered") %>
<% end %>
With icons
Open With icons standalone
- Repository createdScaffolded from the gem template.
- First deployShipped to staging behind the feature flag.
- Incident openedElevated 5xx rate on checkout - rolled back in 12 minutes.
<%= poetry_timeline(class: "max-w-md") do |timeline| %>
<% timeline.with_item(title: "Repository created", time: "Jun 2", icon: :"git-branch", completed: true) do %>
Scaffolded from the gem template.
<% end %>
<% timeline.with_item(title: "First deploy", time: "Jun 4", icon: :rocket, completed: true) do %>
Shipped to staging behind the feature flag.
<% end %>
<% timeline.with_item(title: "Incident opened", time: "Jun 9", icon: :"triangle-alert") do %>
Elevated 5xx rate on checkout - rolled back in 12 minutes.
<% end %>
<% end %>
API
Poetry::Ui::Timeline::Component — options are
constructor keywords (the poetry_* helper forwards them);
slots are composed inside the block. Generated from the gem's source documentation.
| Option | Type | Details | Description |
|---|---|---|---|
| orientation: | Symbol | one of: vertical, horizontal; defaults to :vertical |
The layout axis: :vertical reads as a feed, :horizontal as a step tracker. |
Slots
| Writer | Description |
|---|---|
| with_item | Declares one event: title:, optional time: (renders a <time>), optional icon: (replaces the dot), completed: for progress - the description is the block. |
Styling
Every part carries a stable data-slot attribute — target
[data-slot=…] from your own CSS to restyle it. State rides
data attributes on the parts below. This contract is verified against rendered DOM in CI.
| Part | Description |
|---|---|
| [data-slot=timeline] | The <ol> root - the event sequence |
| [data-slot=timeline-item] | One event (<li>): indicator + rail segment + header + description |
| [data-slot=timeline-indicator] | The decorative marker on the rail - a dot, or icon:'s glyph (aria-hidden; the sequence lives in the list semantics) |
| [data-slot=timeline-separator] | The decorative rail segment toward the next item - hidden on the last |
| [data-slot=timeline-header] | The title/time row |
| [data-slot=timeline-title] | The event's name |
| [data-slot=timeline-time] | The event's <time> - muted, small |
| [data-slot=timeline-content] | Muted description under the header (the item's block) |
State attributes
| Part | Attribute | Condition | Values |
|---|---|---|---|
| timeline | data-orientation | always - the layout axis | vertical · horizontal |
| timeline-item | data-completed | the step is done - recolors its indicator and rail segment | — |