DSL syntax
Complete syntax reference for the Wiremark DSL — the text format for describing UI wireframes.
Root block
Every Wiremark document must start with either wiremarkUI or the short alias ui. This is the root block keyword.
wiremarkUI
page "My Screen" { } ui
page "My Screen" { } Both are equivalent. wiremarkUI is preferred in documentation for clarity.
import
External stylesheets can be loaded into the SVG output using import before the root block:
import "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
wiremarkUI
page "Home" { } Only https:// and http:// URLs are accepted. Imports are injected as <link> elements inside the SVG <defs> block.
Pages
Pages are the top-level containers. Every page becomes one frame in the rendered SVG.
Anonymous page (no ID):
wiremarkUI
page "Dashboard" {
header "My App"
} Named page (with ID for flows and button links):
wiremarkUI
page HOME "Home" { }
page ABOUT "About" { }
HOME --> ABOUT The ID (HOME, ABOUT) is an uppercase identifier used in flow declarations and button ... link targets. The quoted string is the page title displayed in the frame header.
Components
Components follow this syntax rule:
kind "label" [modifiers] [{ children }] kind— a keyword (button,table,nav,metric, etc.)"label"— an optional quoted stringmodifiers— optional single-word keywords on the same line (primary,active,disabled, etc.){ children }— an optional block containing child components
Inline (no block):
button "Save" primary
input "Email" error
alert "Something went wrong" error Block (with children):
form {
input "Name"
input "Email"
button "Submit" primary
} Named declarations
Components can be declared at the root level (outside any page) with an identifier, then referenced inside any page by that identifier. The resolver replaces the reference with a deep copy of the declaration.
wiremarkUI
sidebar SD {
nav "Dashboard" active, "Users", "Settings"
}
header H "My App"
page "Screen A" {
H
SD
text "Content A"
}
page "Screen B" {
H
SD
text "Content B"
} Declarations must appear before their first use. Any component kind can be declared.
Flow declarations
Flow declarations define navigation order between named pages. They appear at the end of the document, outside any page block.
HOME --> USERS --> DETAIL Directional arrows:
| Arrow | Direction | Grid placement |
|---|---|---|
--> or -r-> | Right | target placed in next column, same row |
-d-> | Down | target placed in next row, same column |
-u-> | Up | target placed in previous row, same column |
-l-> | Left | target placed in previous column, same row |
Mixed-direction chains are supported:
HOME -r-> USERS -d-> DETAIL This places USERS to the right of HOME, and DETAIL below USERS.
Modifiers
Modifier words follow the component label on the same line. Multiple modifiers are separated by spaces.
| Modifier | Effect |
|---|---|
primary | Filled blue background (buttons) |
disabled | Reduced opacity, non-interactive appearance |
active | Highlighted active state (nav items) |
error | Red styling (inputs, alerts) |
warning | Amber styling (alerts) |
info | Blue styling (alerts) |
horizontal | Forces horizontal layout |
vertical | Forces vertical layout |
centered | Centers content horizontally |
small | Small variant (icons: 12px) |
large | Large variant (icons: 24px) |
Full example
A complete two-page application with a shared sidebar, metric grid, data table, and a right-pointing flow: