Components Data display

List item

Present an item, its description, and an optional status in one compact row.

Live previewGo + HTML

Layout guide

Grid, flexbox, and spacing utilities.

Reference

Usage

Use Title and Description for the primary content. Add Status for a secondary label. If the item has a destination, set Href to render the title as a link.

Register item with Head and pass its properties to Render. Go setup guide

Go usage
Go usage
err := mono.UI.Render(w, "item", mono.Props{
	"Description": "Grid, flexbox, and spacing utilities.",
	"Href":        "/docs/grid-template-columns.html",
	"Status":      "Reference",
	"Title":       "Layout guide",
})
Rendered HTML
Rendered HTML
<article data-mono="item" id="demo-item" class="mu-panel mu-row">
  <div><h3 class="mu-label"><a href="/docs/grid-template-columns.html">Layout guide</a></h3><p class="mu-muted mu-small">Grid, flexbox, and spacing utilities.</p></div>
  <span class="mu-badge">Reference</span>
</article>
Go template
Go template
<article data-mono="item" id="{{.ID}}" class="mu-panel mu-row">
  <div><h3 class="mu-label">{{if .Href}}<a href="{{.Href}}">{{.Title}}</a>{{else}}{{.Title}}{{end}}</h3><p class="mu-muted mu-small">{{.Description}}</p></div>
  {{with .Status}}<span class="mu-badge">{{.}}</span>{{end}}
</article>
Component CSS
Component CSS
[data-mono="item"] { justify-content:space-between; gap:1rem; }
[data-mono="item"] a { color:inherit; text-decoration:underline; text-underline-offset:.2rem; }
Use the HTML in a static site

Copy the rendered HTML above. Download these assets into the same folder as your page, then add the tags below to its head.

Shared CSS Component CSS

HTML head
<link rel="stylesheet" href="./base.css">
<link rel="stylesheet" href="./item.css">

Copy into your project

Run this command from the Mono checkout. Set -out to the component directory in your application.

Terminal
go run ./cmd/mono-ui add -out ./components item
Example properties (JSON)
example.json
{
  "Description": "Grid, flexbox, and spacing utilities.",
  "Href": "/docs/grid-template-columns.html",
  "Status": "Reference",
  "Title": "Layout guide"
}