Skip to content

Examples

Explore complete, working Wire-DSL examples. All examples are available in the examples/ folder of the repository.


  1. Open the web editor: cd apps/web && pnpm dev
  2. Copy the example code from the file
  3. Paste it into the editor
  4. See live preview on the right

Render an example to SVG:

Terminal window
cd packages/cli
pnpm build
node dist/index.js render ../../examples/admin-dashboard.wire -o dashboard.svg
  1. Copy an example file
  2. Modify it for your needs
  3. Use it as a template

layout split(sidebar: 260, gap: md) {
layout stack(gap: lg, padding: lg) {
component Topbar title: "Dashboard"
component SidebarMenu items: "..."
}
layout stack(gap: md, padding: lg) {
layout grid(columns: 12, gap: md) {
cell span: 3 { component StatCard ... }
cell span: 3 { component StatCard ... }
}
component Table columns: "..." rows: 10
}
}
layout stack(direction: vertical, gap: md, padding: lg) {
component Heading text: "Form Title"
component Input label: "Field 1"
component Input label: "Field 2"
component Textarea label: "Comments" rows: 4
layout stack(direction: horizontal, gap: md, align: "right") {
component Button text: "Cancel" variant: secondary
component Button text: "Submit" variant: primary
}
}
layout grid(columns: 12, gap: lg, padding: lg) {
cell span: 4 {
layout card(padding: lg, gap: md, radius: md) {
component Image placeholder: "square" height: 200
component Heading text: "Item"
component Text content: "Description"
component Button text: "Action" variant: primary
}
}
// ... repeat for 3 columns
}

New to Wire-DSL? Follow this learning path:

  1. Start: Installation
  2. First Wireframe: Create Your First Wireframe
  3. Explore: Web Editor Guide
  4. Learn Syntax: DSL Syntax Reference
  5. Learn Components: All 23 Components
  6. Master Layouts: Containers & Layouts
  7. Study Examples: The examples in this section
  8. Build Your Own: Create your own wireframes

Have a cool example? Contribute it to the project:

  1. Create a .wire file with your example
  2. Add it to the examples/ folder
  3. Submit a pull request

See Contributing for more details.


All examples follow this structure:

project "Example Name" {
theme {
density: "normal"
spacing: "md"
radius: "md"
stroke: "normal"
font: "base"
}
screen ScreenName {
layout ... {
// Content here
}
}
}

This ensures:

  • ✅ Valid Wire-DSL syntax
  • ✅ Complete theme configuration
  • ✅ Clear, readable code
  • ✅ Useful patterns and practices

  • Copy & Customize: Take an example and modify it
  • Mix & Match: Combine patterns from different examples
  • Theme Variations: Try different theme values
  • Test Layouts: Experiment with different layout types
  • Learn Components: See how components are used in context