{% surface %}
Attributes
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | β | Unique kebab-case surface id (e.g., 'login-form') |
title | string | β | Human-readable screen name |
type | enum | β | atomic | widget | screen |
feature | string | β | Qualified id of the feature or flow this surface represents |
showroom | string | β | Category path for the Component Gallery (e.g. 'Forms', 'Patterns/Ecommerce'). Supports '/' for hierarchy. |
group | string | β | UIs with the same group ID are rendered together in a tabbed view |
label | string | β | The tab label used when this surface is part of a group. Defaults to title. |
width | string | β | CSS min-width for the surface container in the gallery (e.g. '600px', '40rem') |
Valid Children
| Tag | Multiplicity |
|---|---|
{% interactions %} | [*] |
Valid Parent Contexts
This tag is valid inside: {% feature %}, {% story %}
Rules
| Rule | Force | Realm | Reference | Description |
|---|---|---|---|---|
surface-pug-strict-subset | | | β | Only Pug tags, attributes, and nesting are supported. No mixins, includes, or JavaScript logic. |
surface-atomic-no-children | | | β | Atomic components (like , ) cannot have children. |
surface-textual-text-only | | | β | Textual components (like , ) can only contain text or string references. |
surface-container-any | | | β | Container components (like , ) can contain any other valid components. |
The surface tag allows you to author low-fidelity wireframes directly in your specification using a subset of Pug compiled into themed HTML elements. See the UI DSL Reference for all available components.
Live interactive examples for every component are available in the Component Gallery.
Component Gallery Categories
The Component Gallery at /showroom is split into sub-pages by category to keep page load times fast. Each category page loads only its own surfaces.
The category is determined by the showroom attribute value on each surface. The value is a category path that supports / for hierarchical grouping:
showroom value | Category page | Sidebar |
|---|---|---|
"Forms" | /showroom/forms | Top-level link |
"Buttons" | /showroom/buttons | Top-level link |
"Patterns/Ecommerce" | /showroom/patterns/ecommerce | Nested under βPatternsβ |
"Patterns/Blog" | /showroom/patterns/blog | Nested under βPatternsβ |
To add a new category, simply use a new showroom value on a surface. The compiler will automatically generate a page and sidebar entry for it. Hierarchical paths create nested sidebar groups.
{% surface id="login-form" title="User Login" %}```pugcard stack(gap="lg") heading(level="1") Login to your account stack(gap="md") input(label="Email" placeholder="user@example.com" required) input(label="Password" type="password" required) row(justify="between") checkbox Remember me button(variant="ghost") Forgot password? button(variant="primary") Login```{% /surface %}{% surface id="tabs-example" title="Tabbed Variants" showroom="Examples" group="tabs-demo" label="Basic" %}```pugstack(gap="md") heading(level="2") Basic Tab text This is the first tab content.```{% /surface %}
{% surface id="tabs-example-2" title="Tabbed Variants" showroom="Examples" group="tabs-demo" label="Advanced" %}```pugstack(gap="md") heading(level="2") Advanced Tab text This is the second tab content with more complex layout. button(variant="primary") Action```{% /surface %}