Skip to content

Using the Web Editor

The Wire-DSL web editor is a live, interactive environment for building and previewing wireframes in real-time.

Terminal window
cd apps/web
pnpm dev

Open http://localhost:3000 in your browser.

The web editor has three main sections:

┌─────────────────────────────────────────┐
│ Wire-DSL Editor │
├──────────────────┬──────────────────────┤
│ │ │
│ Code Editor │ Live Preview │
│ (Left Panel) │ (Right Panel) │
│ │ │
│ • Syntax │ • Real-time │
│ highlighting │ rendering │
│ • Monaco │ • Responsive │
│ Editor │ design │
│ • Errors & │ • SVG output │
│ warnings │ │
│ │ │
└──────────────────┴──────────────────────┘
  • Syntax Highlighting: Wire-DSL syntax is color-coded
  • Auto-completion: Type hints for keywords and components
  • Error Messages: Real-time validation with line numbers
  • Monaco Editor: Familiar VS Code-like experience
ShortcutAction
Ctrl+SSave current code
Ctrl+/Toggle comment
Ctrl+ZUndo
Ctrl+Shift+ZRedo
Alt+Shift+FFormat code
  • Real-time Updates: Preview updates as you type
  • Interactive: Hover over components to see details
  • Responsive: Test different viewport sizes
  • Zoom Controls: Zoom in/out to inspect details
  • Export: Download as SVG or PNG

The editor includes starter templates. Choose one or start blank.

Modify the code in the left panel. The preview updates automatically.

If there are syntax errors, they appear in red with helpful messages.

Adjust spacing, components, and layout based on the preview.

Download the final wireframe in SVG or PNG format.

Missing or incomplete theme block (optional but recommended):

Warning: theme block recommended for consistent styling

Solution: Add a theme block to define design tokens. If omitted, defaults are applied.

Invalid component name:

Error: Unknown component "BadComponent"

Solution: Check the Components Reference for valid component names.

Mismatched brackets:

Error: Expected "}" but found "{" on line 42

Solution: Count opening and closing braces.

When there are errors, the preview panel shows:

  • Error message
  • Line number
  • Suggestion for fixing
project "Layout Tests" {
theme {
density: "normal"
spacing: "md"
radius: "md"
stroke: "normal"
font: "base"
}
screen StackExample {
layout stack(direction: vertical, gap: md) {
component Heading text: "Vertical Stack"
component Text content: "Items stack top-to-bottom"
}
}
screen GridExample {
layout grid(columns: 12, gap: md) {
cell span: 6 { component Text content: "Left" }
cell span: 6 { component Text content: "Right" }
}
}
}

If your wireframe has multiple screens, they all render in the preview. Use the screen selector to navigate between them.

Add comments to organize your code:

// Main dashboard
screen Dashboard { ... }
/* Multi-line comment
for detailed explanations */
screen UserDetail { ... }

The examples/ folder has complete working wireframes. Copy them into the editor and modify them to suit your needs.

ShortcutAction
TabIndent code
Shift+TabDecrease indent
Ctrl+HFind and replace
Ctrl+GGo to line
Ctrl+K Ctrl+0Fold all regions
Ctrl+K Ctrl+JUnfold all regions

Export your wireframes and commit them to git:

  1. Download SVG: Click “Export” and select SVG
  2. Commit to git: git add wireframes/ && git commit -m "Add wireframes"
  3. Track changes: Version control system shows all modifications
  • The editor is read-only in terms of design; you create wireframes with code
  • Real-time preview is limited to standard screen sizes
  • Very large wireframes (100+ components) may slow down preview

Happy wireframing! 🚀