Compose a tool or report
Start with the task and its important state. Use the catalog to find a part, not to decide how many parts a page should contain.
Workspace evidence review
The evidence workspace is a complete selection → inspection → decision composition. Compare a captured baseline and trial, switch to an unobserved run, inspect the retained source, and record a local next step. The figure, fallback table, source and review receipt refer to the same selected observation, including when printed.
Run this workspace
The Vanilla Vite starter
contains the complete workspace as workspace.html. Follow its
copy-and-run instructions
to put the project in an independent directory. From that copied directory:
npm install
npm run dev
Open /workspace.html at the local URL Vite prints. The root / page is a
small theme-and-toast example. The starter's declared @ponchia/ui dependency
installs the published package; Vite resolves its CSS and JavaScript through
public package exports. npm run build builds both pages, and npm run preview
serves the result with the same routes.
Styles and initialization
workspace.html loads src/workspace-evidence.css before the module script.
That stylesheet starts with these public imports, followed by the host's
layout and print rules:
@import '@ponchia/ui';
@import '@ponchia/ui/css/workbench.css';
@import '@ponchia/ui/css/figure.css';
@import '@ponchia/ui/css/sources.css';
@import '@ponchia/ui/css/state.css';
src/workspace-evidence.mjs imports its behaviors and renderer tokens from
the installed package:
import {
initActionMenu,
initCombobox,
initDialog,
initPopover,
initThemeToggle,
initToolbar,
} from '@ponchia/ui/behaviors';
import { readTokens, observeTokens } from '@ponchia/ui/renderer';
The module runs after the workspace markup exists. Importing a behavior does not initialize it: the supplied controller calls the initializers, binds the host's selection and review actions, and retains their cleanup functions.
The host owns the radio selection, synthetic measurements, SVG geometry and
in-memory review decisions. It paints the SVG immediately with readTokens(),
then uses observeTokens() for later appearance changes. The observer does not
perform the initial paint. In the supplied controller, paintChart is the
host's SVG renderer:
paintChart(readTokens());
const stopTokens = observeTokens(paintChart);
Retain stopTokens with the behavior cleanups and call them when the view is
disposed. The starter also removes its own listeners, disposes on Vite hot
replacement, and preserves them during a persisted pagehide so browser
back/forward-cache restoration resumes a working view. The ordinary HTML table
preserves the values without a renderer or JavaScript. Print uses readable ink
and keeps the source and uncertainty beside the result.
initToolbar() supplies one keyboard entry into the action strip.
initActionMenu() returns focus deliberately when the evidence menu closes.
The review uses initDialog(), with initCombobox() for the next-step field
and initPopover() for the evidence scope. Escape dismisses the active inner
control before the surrounding dialog.
A recorded review is a decision about evidence, not new measurement evidence. An unobserved run therefore stays unknown after review. Each selection retains its own local decision; reloading resets these sample decisions. No operation is executed or saved to a service.
Inspect the HTML, host CSS, and host script. Check the complete task at a narrow width, with keyboard input, in both themes and in print. Focused primitives remain in the workspace interaction specimen.
Service overview
Load the core CSS and the opt-in state leaf. Use ui-app-shell for navigation,
ui-app-topbar for the page title and primary action, and ui-app-content for
the current state and work queue. Panels group content without adding another
frame around every metric and table.
@import '@ponchia/ui';
@import '@ponchia/ui/css/state.css';
Use sentence-case labels. Keep the main action distinguishable from destructive
actions through wording and placement. The default accent may itself be red,
so ui-button and ui-button--danger can have similar filled colors.
Use explicit labels (for example, "Save changes" versus "Delete workspace"),
separate their placement, and let the host own confirmation/undo when relevant:
color alone does not communicate destructive intent.
Use ui-delta--invert when a decrease
is favorable, such as queue delay. Unknown, stale, and failed are distinct
states; do not present missing observations as success.
The complete specimen is service.html. On a phone, navigation wraps and the compact metrics leave room for the work queue. The specimen owns deterministic loading, empty, error and stale scenarios, search/environment filtering and a local sample-job dialog. Unknown observations hide operational health claims; stale ones stay visibly qualified. Use Sync to recover. These behaviors are sample host logic, not package state management.
Check the main action, every navigation destination, and a long account name at 360px and with a coarse pointer. A data table may scroll in its own region.
Inspector and workbench
Load workbench.css beside core. An inspector supplies its own container
boundary: property rows stack below 20rem of available inline size, including
inside a narrow panel on a wide desktop.
<aside class="ui-inspector" aria-label="Selected job">
<header class="ui-inspector__head"><h2>Job settings</h2></header>
<div class="ui-inspector__body">
<div class="ui-property">
<label class="ui-property__label" for="retry-count">Retry limit</label>
<div class="ui-property__value">
<input class="ui-input" id="retry-count" type="number" value="3" />
</div>
</div>
</div>
</aside>
A splitter does not choose a product's collapse policy. The workbench specimen stacks its two panes below 42rem of container width and hides the inactive resize handle and resize controls. Both panes remain available. A tool that needs a pane switch instead should keep that policy in its own component.
Keep a badge inside a ui-row__meta wrapper rather than applying both classes
to the same element: the wrapper owns layout and the badge owns its tone.
Use ui-chip--dense for static labels inside short pane headers. Dense chips
on buttons, links, or button roles retain pointer target floors. Use regular
buttons for actions; a colored chip is not an action registry.
Test the resize control’s keyboard and pointer paths at wide sizes, then verify that the narrow layout has no hidden keyboard-reachable resize control and both panes have a useful reading width. Test the inspector inside a 280px parent while the browser itself is wide.
Decision report
Use the core stylesheet plus report-kit.css for a standalone HTML report.
Use real asset URLs in HTML; package specifiers resolve only in build tools.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.19.3/dist/bronto.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ponchia/ui@0.19.3/dist/css/report-kit.css" />
<article class="ui-report">
<header class="ui-report__cover ui-report__cover--compact">
<h1 class="ui-report__title">Keep the current configuration</h1>
<p class="ui-report__subtitle">Queue delay improved; verify the next scheduled run.</p>
</header>
<section class="ui-report__section" aria-labelledby="decision-title">
<h2 class="ui-report__section-head" id="decision-title">Decision and basis</h2>
<p>The completed runs support keeping the change. The next batch remains unobserved.</p>
</section>
<details class="ui-report__toc ui-screen-only">
<summary>Contents and evidence</summary>
<ol><li><a href="#decision-title">Decision and basis</a></li></ol>
</details>
</article>
Screen prose is 1.125rem with a 68ch maximum reading measure; the report can
still contain wider figures and evidence tables. Print uses 11pt ink-on-white
text. Use the --report-measure and --report-width hooks deliberately.
Do not apply ui-display to every report heading.
The standalone specimen keeps its decision before collapsed navigation. Verify the recommendation and its source are findable, the text remains readable at narrow widths, and the PDF retains claims, captions, and evidence across page boundaries.
Display identity
ui-display, dot glyphs, and readouts preserve the expressive identity.
Use them for a short hero title or deliberate display moment. Ordinary h1
through h4, prose, labels, and controls use sans typography. Fixed-width type is for
code, identifiers, and aligned data; a whole page does not need to be mono to
look technical.
Use one dominant action per local task. Separate navigation, action, severity, and evidence status semantically even when they share a color family. Test light and dark together, and keep keyboard focus and reduced motion visible.
Embedded evidence
Constrain the figure, decision grid or action list inside a wide page. Each
uses its own available width. A two-up comparison wraps intrinsically even
outside ui-report. Keep value columns readable and source links reachable;
page overflow is an incomplete test. The container regression suite checks
280/320/480px parents and a wide layout.
Review long action status, legend names and citation markers. Keep chart
annotations in their viewBox or supply an equivalent narrow fallback. Print
uses document flow instead of size containment.
For an existing application, review explicit typography overrides with the 0.11 migration recipe. A dependency pin does not remove consumer CSS that overrides the shared layer.
Activity, operation receipts and captured sources
Prefer the existing discussion, state and source vocabulary to a second
activity-component system. Import css/discussion.css, css/state.css and
css/sources.css explicitly alongside the tool or default entry.
A read-only activity transcript uses ui-discussion__messages and
ui-discussion__message. Keep ordinary user-visible messages expanded. Use a
native disclosure for details classified by the application as coordination;
failures and unresolved questions should remain visible. A visual tone does
not establish the origin of a message.
<section class="ui-discussion" aria-label="Observed activity">
<ol class="ui-discussion__messages">
<li class="ui-discussion__message">
<p class="ui-discussion__meta">Operator · 09:00</p>
<p>Verify the build before release.</p>
</li>
<li class="ui-discussion__message">
<details>
<summary>Coordination · waiting for capacity</summary>
<p class="ui-state ui-state--queued"><span class="ui-state__label">Queued</span></p>
<p>Execution has not started.</p>
</details>
</li>
</ol>
</section>
An operation receipt should name the observed stage, observation time and a link to evidence. Keep acceptance, execution and verification separate. A task ending does not make a result verified. Use explicit words for unknown or unavailable observations rather than a success tone or a busy animation.
For captured sources, ui-source-card__excerpt holds the original capture;
ui-source-card__time identifies its timestamp and revision. Show a newer
observation separately. A failed re-read must not overwrite the capture, and
an observation must not automatically replay the original operation.
<article class="ui-source-card">
<h3 class="ui-source-card__title">Captured build input</h3>
<p class="ui-source-card__time">09:00 · revision 7a2c · current source not re-read</p>
<blockquote class="ui-source-card__excerpt">Verify this build.</blockquote>
<p>The original capture is retained independently of later observations.</p>
</article>
Identity, freshness thresholds, verification, retries and disclosure decisions remain application policy. The workspace interactions example shows the compositions with the keyboard, splitter and command-sheet contracts.