Skip to content
{% surface %}
AutoXXS (320px)XS (375px)SM (640px)MD (768px)LG (1024px)XL (1280px)XXL (1536px)
SketchMaterialiOSTamagui
DataInjectionKeyPatternsServiceTransactionProcessResearchProductQualityPerformanceSpecDomainFunctionTechnologyArchitectureConfigMiddlewareDataDatabaseDrizzleMigrationModelop-sqliteSchemaSQLState ManagementDraftKeystoneMergePatchPatchesPersistenceReactiveRedoStoreUndoTestingDeviceFactoryIsolationTypeScriptZodTopicsCommunicationBidsNVCDesignDesign ImplicationsEducationPedagogyFoundationsPsychologyAttachmentFloodingRelatingAuthentic RelatingUIEditorReact Native

{% 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 boolean β€” If true, appears in the Component Gallery instead of the main design gallery
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.

Valid Children

TagMultiplicity
{% interactions %}[*]

Valid Parent Contexts

This tag is valid inside: {% feature %}, {% story %}

Rules

Rule Force Realm Reference Description
surface-pug-strict-subset must global β€” Only Pug tags, attributes, and nesting are supported. No mixins, includes, or JavaScript logic.
validationdsl
surface-atomic-no-children must global β€” Atomic components (like , ) cannot have children.
validationdsl
surface-textual-text-only must global β€” Textual components (like , ) can only contain text or string references.
validationdsl
surface-container-any must global β€” Container components (like , ) can contain any other valid components.
validationdsl

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.

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 automatically from the source file’s location under instructions/fragments/uidsl/:

Source pathCategoryURL
uidsl/webawesome/badge.mdocWebAwesome/showroom/webawesome
uidsl/forms.mdocForms/showroom/forms
uidsl/layout.mdocLayout/showroom/layout
uidsl/display.mdocDisplay/showroom/display
uidsl/navigation.mdocNavigation/showroom/navigation

Files outside of uidsl/ are grouped under /showroom/other.

To add a new category, create a new directory under uidsl/ (e.g. uidsl/charts/) and place your .mdoc snippet files inside it. The compiler will automatically generate a /showroom/charts page and add it to the sidebar.

Custom label overrides for known slugs are defined in SHOWROOM_LABELS in packages/compiler/src/passes/public/index.ts. Add an entry there when the auto-generated label (e.g. Css-conventions β†’ CSS Conventions) needs to be corrected.

Login form wireframe with Pug DSL
tagsurfacepug surface-tag-login
{% surface id="login-form" title="User Login" %}
```pug
card
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 %}
Multiple surface variants rendered in a tabbed view using group and label
tagsurfaceshowroomgroup surface-tag-showroom-variants
{% surface id="tabs-example" title="Tabbed Variants" showroom=true group="tabs-demo" label="Basic" %}
```pug
stack(gap="md")
heading(level="2") Basic Tab
text This is the first tab content.
```
{% /surface %}
{% surface id="tabs-example-2" title="Tabbed Variants" showroom=true group="tabs-demo" label="Advanced" %}
```pug
stack(gap="md")
heading(level="2") Advanced Tab
text This is the second tab content with more complex layout.
button(variant="primary") Action
```
{% /surface %}