Key-value list
Label and value rows, each value drawn by its type (text, status pill, money, date, link or identifier), with copy buttons.
KeyValueList draws label / value rows split by hairlines: the label on the left, the value right-aligned and drawn by its type. A detail adds a dim note after the value. The list sits in a card by default, with title as the card's eyebrow.
KeyValueListUsage
import { KeyValueList } from "@antelopejs/interface-dms/base/key-value-list";
static subscription = KeyValueList({
title: "$saas.subscription.title",
fetchUrl: "/api/workspaces/{{params.id}}/subscription", // answers { items }
});
Options
| Option | Type | Default | Description |
|---|---|---|---|
title Content | string | – | Small heading at the top of the card. |
empty.title* Content | string | – | |
empty.description Content | string | – | |
card Appearance | boolean | true | Draws the block on a card; turn it off when it already sits in one. |
dense Appearance | boolean | – | Rows closer together. |
currency Appearance | string | – | The currency of amounts, as a three-letter code such as EUR. |
columns Layout | number | 1 | How many columns once the list is wide enough. |
A row (KeyValueListItem) carries a label and a value, plus optional type, tone, to, detail, currency, copy and copyValue. An empty value shows a dash.
type | The value is drawn as |
|---|---|
text | Plain text. The default. |
status | A pill tinted by tone. |
money | An amount in currency (or the list's). |
date | A localized date from an ISO string. |
link | An accent link to to. |
mono | An identifier, in mono. |
Recipes
Copy a value
copy: true draws a copy button after the value, which copies it as shown. copyValue copies another text instead, such as the full URL behind a short label, and draws the button on its own.
{ id: "endpoint", label: "Public endpoint", value: "https://api.example.com/v1", type: "mono", copy: true },
{ id: "thumb", label: "Thumbnail", value: "thumb · 320×320", copyValue: "https://cdn.example.com/m/42/thumb.webp" },
Inside a card
Set card: false to place the list inside a Card or a Section; dense: true tightens the rows for a side panel.
Pitfalls
moneyvalues are amounts in the currency's unit as you send them; a composed textmoneyparameter, by contrast, takes minor units.- A composed
valueis drawn as text whatever the row'stype: its parameters already say how each value is written.
