DescriptionList
Terms and their details, stacked or in two columns that stack on phones, on a real <dl>.
Demo
- Customer
- Northwind Traders
- Plan
- Business, billed yearly
- Billing email
- accounts@northwind.example
- Address
- 1 Harbour Street, Portsmouth PO1 3AH, United Kingdom
- Status
- Paid
- Amount
- $1,204.50
- Invoice
- INV-1042
- Created
- March 3, 2026
- Owner
- Ada Lovelace
Get it
It needs theme.qwe, as every component does; or take the whole kit, quillo-ui.qwe. Each component brings its own styles to the pages that show it.
$ curl -O https://quillolang.org/components/ui/theme.qwe$ curl -O https://quillolang.org/components/ui/description_list.qwemain.qwe
import ui/theme.qwe use theme_cssuse ui/description_list.qweroute GET / = <html><head><style>{theme_css}</style></head><body class="ui-root">...</body></html>Example
The code of the preview above.
demos/description_list.qwe
view DescriptionListDemo() = <div.demo-stack> <DescriptionList layout="columns" items={[ { term: "Customer", detail: "Northwind Traders" }, { term: "Plan", detail: "Business, billed yearly" }, { term: "Billing email", detail: "accounts@northwind.example" }, { term: "Address", detail: "1 Harbour Street, Portsmouth PO1 3AH, United Kingdom" }, ]}/> <div.demo-row style="align-items: flex-start; gap: 40px"> <div.demo-narrow.demo-wide> <DescriptionList> <DescriptionItem term="Status"><Badge tone="success" dot={true}>Paid</Badge></DescriptionItem> <DescriptionItem term="Amount" detail="$1,204.50"/> <DescriptionItem term="Invoice"><a href="#description_list">INV-1042</a></DescriptionItem> </DescriptionList> </div> <div.demo-narrow.demo-wide> <DescriptionList dividers={false} items={[ { term: "Created", detail: "March 3, 2026" }, { term: "Owner", detail: "Ada Lovelace" }, ]}/> </div> </div> </div>Source
ui/description_list.qwe
// DescriptionList: terms and what they are, as on a details page: "Status: Paid".//// <DescriptionList layout="columns" items={[// { term: "Customer", detail: "Northwind Traders" },// { term: "Plan", detail: "Business, yearly" },// ]}/>// <DescriptionList>// <DescriptionItem term="Status"><Badge tone="success">Paid</Badge></DescriptionItem>// <DescriptionItem term="Email" detail="ada@example.com"/>// </DescriptionList>//// items: a list of { term, detail } with text details; children: DescriptionItems,// whose detail can be any HTML (their children). Both may be given; items come first.// layout: "stacked" (default: each term over its detail) or "columns" (the term on// the left, the detail on the right, stacked again where it is narrow).// dividers: lines between the items (true by default). It is a real <dl>.import ui/theme.qwe use ui_clslet description_list_css = css`.ui-dl { margin: 0; container-type: inline-size; font: 14px/1.5 var(--ui-font); color: var(--ui-fg); }.ui-dl-item { display: grid; gap: 2px; padding: 10px 0; }.ui-dl-item:first-child { padding-top: 0; }.ui-dl-item:last-child { padding-bottom: 0; }.ui-dl-lines .ui-dl-item + .ui-dl-item { border-top: 1px solid var(--ui-border); }.ui-dl dt { color: var(--ui-muted); font-size: 13px; font-weight: 500; }.ui-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }.ui-dl-columns .ui-dl-item { grid-template-columns: minmax(120px, 1fr) 2fr; gap: 16px; align-items: baseline; }.ui-dl-columns dt { font-size: 14px; }@container (max-width: 440px) { .ui-dl-columns .ui-dl-item { grid-template-columns: 1fr; gap: 2px; } .ui-dl-columns dt { font-size: 13px; }}`view DescriptionItem(term: str, detail = null, children) { style global description_list_css <div.ui-dl-item> <dt>{term}</dt> <dd>{detail != null ? detail : children}</dd> </div>}view DescriptionList(items: list = [], layout: str = "stacked", dividers: bool = true, class: str? = null, children) { style global description_list_css <dl class={ui_cls(["ui-dl", `ui-dl-${layout}`, dividers && "ui-dl-lines", class])}> {for it in items => <DescriptionItem term={it.term} detail={it.detail}/>} {children} </dl>}Related
DataListRecords as rows with a title, a line of facts, a status badge and actions as links or buttons.6 views · 8 downloadsActivityFeedA stream of what people did, with their pictures, an icon for each kind of action, when, quotes and day headings.5 views · 7 downloadsChangelogReleases with version, date and label, their changes grouped by kind: Added, Changed, Fixed, Security and the rest.6 views · 7 downloadsFileListFiles as a table or a grid, with kind icons, sizes and dates, sorted, picked, downloaded or deleted.7 views · 6 downloadsKanbanBoardColumns of cards moved by dragging, by keyboard (Space, the arrows, Space) or with each card's arrows.9 views · 6 downloadsLeaderboardPeople ranked by score with medals for the top three, shared places for ties, and your own row kept in view.7 views · 7 downloads
Thread
Thread 0 posts
On DescriptionList: questions, tips, corrections, and code that uses it.
No posts yet. The first one opens the thread.