Components Data display

Execution trace

Inspect an ordered record of a task, its outcomes, and supporting details.

Live previewGo + HTML

Print preparation

  1. Read source filesComplete

    Loaded the cover, contents, and colophon pages.

  2. Check page sizeComplete

    All pages use the selected A5 trim size.

  3. Export proofQueued

    Waiting for the next available print slot.

Usage

Provide Steps with Label, Status and Detail. Open can expand a particular step initially. Each summary is a native control that can be toggled with Enter or Space.

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

Go usage
Go usage
err := mono.UI.Render(w, "trace", mono.Props{
	"Steps": []any{
		map[string]any{
			"Detail": "Loaded the cover, contents, and colophon pages.",
			"Label":  "Read source files",
			"Open":   false,
			"Status": "Complete",
		},
		map[string]any{
			"Detail": "All pages use the selected A5 trim size.",
			"Label":  "Check page size",
			"Open":   true,
			"Status": "Complete",
		},
		map[string]any{
			"Detail": "Waiting for the next available print slot.",
			"Label":  "Export proof",
			"Open":   false,
			"Status": "Queued",
		},
	},
	"Title": "Print preparation",
})
Rendered HTML
Rendered HTML
<section data-mono="trace" id="demo-trace" class="mu-card mu-stack" aria-labelledby="demo-trace-title">
  <h3 id="demo-trace-title" class="mu-label">Print preparation</h3>
  <ol class="mu-list"><li><details >
    <summary class="mu-disclosure"><span>Read source files</span><span class="mu-badge">Complete</span></summary>
    <p class="mu-small mu-muted">Loaded the cover, contents, and colophon pages.</p>
  </details></li><li><details open>
    <summary class="mu-disclosure"><span>Check page size</span><span class="mu-badge">Complete</span></summary>
    <p class="mu-small mu-muted">All pages use the selected A5 trim size.</p>
  </details></li><li><details >
    <summary class="mu-disclosure"><span>Export proof</span><span class="mu-badge">Queued</span></summary>
    <p class="mu-small mu-muted">Waiting for the next available print slot.</p>
  </details></li></ol>
</section>
Go template
Go template
<section data-mono="trace" id="{{.ID}}" class="mu-card mu-stack" aria-labelledby="{{.ID}}-title">
  <h3 id="{{.ID}}-title" class="mu-label">{{.Title}}</h3>
  <ol class="mu-list">{{range .Steps}}<li><details {{if .Open}}open{{end}}>
    <summary class="mu-disclosure"><span>{{.Label}}</span>{{with .Status}}<span class="mu-badge">{{.}}</span>{{end}}</summary>
    <p class="mu-small mu-muted">{{.Detail}}</p>
  </details></li>{{end}}</ol>
</section>
Component CSS
Component CSS
[data-mono="trace"] ol { margin:0; padding:0; list-style:none; }
[data-mono="trace"] li { position:relative; margin-inline-start:.3rem; padding:.12rem 0 .6rem .85rem; border-inline-start:1px solid #aaa; }
[data-mono="trace"] li::before { content:""; position:absolute; width:.45rem; height:.45rem; border-radius:50%; background:#191919; inset-inline-start:-.25rem; top:.6rem; }
[data-mono="trace"] li:last-child { padding-bottom:0; }
[data-mono="trace"] summary { cursor:pointer; }
[data-mono="trace"] summary .mu-badge { font-size:.68rem; }
[data-mono="trace"] details p { margin:.35rem 0 0; }
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="./trace.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 trace
Example properties (JSON)
example.json
{
  "Steps": [
    {
      "Detail": "Loaded the cover, contents, and colophon pages.",
      "Label": "Read source files",
      "Open": false,
      "Status": "Complete"
    },
    {
      "Detail": "All pages use the selected A5 trim size.",
      "Label": "Check page size",
      "Open": true,
      "Status": "Complete"
    },
    {
      "Detail": "Waiting for the next available print slot.",
      "Label": "Export proof",
      "Open": false,
      "Status": "Queued"
    }
  ],
  "Title": "Print preparation"
}