Earlier formats
Stout guarantees
What the stout component set promises: bounded props, no free-form CSS, per-element error boundaries, versioned specs, and themes that just work.
"Stout" is the name of the component set behind ui artifacts. It is built so an agent cannot make a page that breaks, leaks, or looks out of place, and so a saved page keeps working as the site changes.
Bounded propsLink to this section
Every string has a maximum length and every array a maximum size, from the props schemas in src/lib/ui/props. Numbers must be finite. Dates, time zones, and currency codes are checked as real values. The whole spec is capped at 200,000 bytes and 500 elements. A valid spec therefore has a known worst case, and the gallery tests every component at its limits: the longest text, the most rows, huge and negative numbers.
No free-form CSSLink to this section
There is no style, className, or color prop anywhere. Layout comes from Stack, Grid, Section, Card, and Box, whose spacing, surface, border, and radius are named steps on fixed scales, never CSS values; emphasis comes from tone (neutral, info, success, warning, danger) and chart colors from a fixed palette. Every color is a theme token, so a page always matches the site, and an agent cannot hide text or break the layout. An agent can draw a form but cannot collect what a reader types: fields only change the page's own state, nothing is ever sent, and password fields cannot be typed into.
Per-element error boundariesLink to this section
Each element renders behind its own error boundary, and its props are checked again after dynamic values resolve. A problem in one element shows a small notice in its place; the rest of the page renders. Unknown component types render nothing. Only problems that make the whole page unsafe to draw, such as a missing root or a cycle, stop it.
This spec would not pass validation, but if a stored page ever holds one like it, only the broken elements show a notice.
2 parts of this interface could not be shown.
Show details
- ErrorElement "chart" (Chart): props.type: Invalid option: expected one of "bar"|"line"|"area"|"pie"|"donut"|"scatter"
- ErrorElement "metric" (Metric): props.value: Invalid input
Elements around the broken ones render normally.
Show JSONHide JSON
{
"version": 1,
"root": "page",
"elements": {
"page": {
"type": "Stack",
"props": { "gap": "md" },
"children": ["before", "chart", "metric", "after"]
},
"before": {
"type": "Text",
"props": { "text": "Elements around the broken ones render normally." }
},
"chart": {
"type": "Chart",
"props": {
"type": "radar",
"labels": ["a"],
"series": [{ "name": "x", "values": [1] }]
}
},
"metric": { "type": "Metric", "props": { "label": "Missing value" } },
"after": {
"type": "Badge",
"props": { "label": "still here", "tone": "success" }
}
}
}Versioned specsLink to this section
A spec records the component-set version it was written for (now 1). Changes to the set are additive: new components and new optional props never change what an existing spec means. When a change must alter existing props, the version goes up and a migration step rewrites older specs on read (src/lib/ui/version.ts), so pages saved today keep their meaning.
Nothing runs, nothing loadsLink to this section
- No agent code runs. The renderer maps known component names to our own React components; there is no HTML, script, or eval path.
- Actions only change on-page state. Nothing can fetch, send, navigate, or save.
- Links allow only absolute
http,https, andmailtoURLs, and open in a new tab. Markdown skips raw HTML, and its images show as alt text. - Images and files come only from uploads attached to the artifact, by id, through the same access check as the page. A spec cannot load anything from another site, so it cannot track readers.
- Mermaid diagrams render in strict mode and show as an image.
- State paths that could reach
__proto__,constructor, orprototypeare refused.
Themes, light and dark, and small screensLink to this section
Every component reads the page's color and font tokens. These come from the site's light and dark look, or from the artifact's own theme. So a page follows the reader's light or dark choice and the artifact's theme with no work from the agent. Layouts adapt to the screen: Grid drops to one column on phones, horizontal Stacks wrap, wide tables and boards scroll inside themselves, and the month calendar becomes a list. Text uses the site's type scale, and inputs are real, keyboard-accessible controls. Try the theme switcher in the footer while you read the component pages.