Metadata List
A key-value list for labeled attributes on detail pages.
Installation
Included in poetry-ui — available as
poetry_metadata_list
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 metadata-list
Default
Open Default standalone
- Status
- Active
- Owner
- Ada Lovelace
- Created
- June 12, 2026
<%= poetry_metadata_list do |list| %>
<% list.with_item(label: "Status") { "Active" } %>
<% list.with_item(label: "Owner") { "Ada Lovelace" } %>
<% list.with_item(label: "Created") { "June 12, 2026" } %>
<% end %>
Two columns
Open Two columns standalone
- Invoice
- INV-0042
- Amount
- $1,250.00
- Status
- Paid
- Method
- ACH transfer
<div class="w-full max-w-lg">
<%= poetry_metadata_list(columns: :two) do |list| %>
<% list.with_item(label: "Invoice") { "INV-0042" } %>
<% list.with_item(label: "Amount") { "$1,250.00" } %>
<% list.with_item(label: "Status") do %>
<%= poetry_badge(variant: :success) { "Paid" } %>
<% end %>
<% list.with_item(label: "Method") { "ACH transfer" } %>
<% end %>
</div>
API
Poetry::Ui::MetadataList::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 |
|---|---|---|---|
| columns: | Symbol | one of: one, two, three; defaults to :one |
How many columns the facts spread across on wide viewports. |
| orientation: | Symbol | one of: vertical, horizontal; defaults to :vertical |
Label placement - above the value, or beside it for the classic key/value sheet. |
Slots
| Writer | Description |
|---|---|
| with_item | The facts. Each takes label: (the fact's name, the <dt>) and the value as its block (the <dd>). |
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=metadata-list] | The <dl> root - the record's fact sheet |
| [data-slot=metadata-list-item] | One fact group (a <div> holding its <dt>/<dd> pair) |
| [data-slot=metadata-list-label] | The fact's name (<dt>) - muted, small |
| [data-slot=metadata-list-value] | The fact's value (<dd>) - composes text, badges, links |
State attributes
| Part | Attribute | Condition | Values |
|---|---|---|---|
| metadata-list | data-orientation | always - label placement | vertical · horizontal |
| metadata-list | data-columns | always - the column count word | one · two · three |