Skip to content

Wire-DSL/wire-dsl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

150 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎨 WireDSL

Wireframes as Code. Declarative wireframing with AI-friendly syntax.

License: MIT npm version Build Node.js TypeScript

What is WireDSL?

WireDSL is a code-first wireframing tool that lets you:

  • ✍️ Write wireframes as declarative code (like Mermaid, but for UI)
  • πŸ€– Generate from plain English ("Create a login form..." β†’ automatic wireframe)
  • πŸ“¦ Export to SVG, PNG, PDF
  • πŸ”“ 100% open-source and free forever
  • βš™οΈ AI-friendly syntax for LLM-powered generation

πŸš€ Quick Start

Try online (no installation needed):

Visit live.wire-dsl.org to use the web editor in your browser.

Start the web editor locally (connected to your files):

pnpm install && cd apps/web && pnpm dev

β†’ Open http://localhost:3000

Try the CLI (one-liner):

npm install -g @wire-dsl/cli && wire render examples/simple-dashboard.wire -o output.svg

Use as a library:

npm install @wire-dsl/engine
import { parseWireDSL, generateIR } from '@wire-dsl/engine';

🎬 Demo: .wire Code β†’ SVG Preview

Live editor showing:

  • Left: .wire code in Monaco editor
  • Right: Real-time SVG preview (hot reload)
  • Changes appear instantly as you type

Note: screenshot from Wire Live on live.wire-dsl.org.


πŸ“– First Time? Read This

  1. QUICKSTART.md - Setup guide (5 minutes)
  2. MONOREPO.md - How the project is organized (10 minutes)
  3. docs/DOCUMENTATION-INDEX.md - Complete documentation index

πŸ“š Full Documentation

Getting Started

Technical & Design

Component & Container References

Planning & Roadmap

Examples


🎯 Why WireDSL?

WireDSL is a platform for creating declarative wireframes where:

  • ✍️ You declare, you don't draw
  • πŸ€– AI-friendly: predictable syntax for automatic generation
  • πŸ“ Deterministic: same input β†’ same output
  • πŸ”„ Versionable: wireframes are code

Quick Example

project "Dashboard" {
  style {
    density: "normal"
    spacing: "md"
    radius: "md"
    stroke: "normal"
    font: "base"
  }

  screen Home {
    layout stack(direction: vertical, gap: md, padding: lg) {
      component Heading text: "Welcome"
      component Button text: "Get Started"
    }
  }
}

πŸ“¦ Packages & Apps

Package/App Purpose Status
@wire-dsl/engine Parser, IR, layout, renderer βœ… Published
@wire-dsl/exporters SVG, PNG, PDF export (Node.js) βœ… Published
@wire-dsl/cli Command-line tool βœ… Published
@wire-dsl/language-support VS Code syntax & type support βœ… Published
wire-dsl/web Live web editor βœ… Published
wire-dsl/docs Documentation site βœ… Published

🎯 Example Workflow

1. Write Wireframe Code

project "Login Form" {
  style {
    density: "normal"
    spacing: "md"
    radius: "md"
    stroke: "normal"
    font: "base"
  }

  screen LoginScreen {
    layout panel(padding: lg, background: "white") {
      layout stack(direction: vertical, gap: md) {
        component Heading text: "Sign In"
        component Input label: "Email" placeholder: "your@email.com"
        component Input label: "Password" placeholder: "β€’β€’β€’β€’β€’β€’β€’β€’"
        component Checkbox label: "Remember me"
        component Button text: "Sign In" variant: primary
      }
    }
  }
}

2. See Live Preview

  • Monaco editor on the left
  • SVG preview on the right
  • Hot reload as you type

3. Generate with AI

User: "Create a login form with email, password, and remember me"
β†’ LLM generates .wire code
β†’ Preview appears instantly
β†’ Edit if needed

4. Export

  • SVG (scale to any size)
  • PNG (with optional resizing)
  • PDF (multipage support)

πŸ› οΈ Tech Stack

Core

  • TypeScript 5.3 (strict mode)
  • Chevrotain 11.x (parser)
  • Zod 4.x (validation)

Web Editor

  • React
  • Vite
  • Monaco Editor
  • Tailwind CSS

DevOps

  • pnpm + Turborepo
  • Vitest (testing)
  • GitHub Actions (CI/CD)
  • Changesets (versioning)

Deployment

  • Cloudflare Pages (web editor)
  • NPM (CLI tool)

πŸ“Š Architecture

.wire (text)
   ↓
Parser (Chevrotain)
   ↓
AST (tokens)
   ↓
IR Generator
   ↓
IR Contract (JSON)
   ↓
Layout Engine
   ↓
Positioned Elements
   ↓
SVG Renderer
   ↓
SVG / PNG / PDF

🚒 Deployment

  • Web Editor: Automatic via Cloudflare Pages (git push β†’ live)
  • CLI Tool: Automatic via GitHub Actions + NPM (changesets β†’ publish)

πŸ“¦ What's Included

Free & Open Source

  • βœ… Engine library (@wire-dsl/engine) - Pure TypeScript parser + layout
  • βœ… Exporters library (@wire-dsl/exporters) - SVG, PNG, PDF output
  • βœ… CLI tool (@wire-dsl/cli) - Command-line rendering
  • βœ… Language support (@wire-dsl/language-support) - VS Code integration
  • βœ… Web editor - Live editing and preview with AI integration
  • βœ… Full source code on GitHub

🀝 Contributing

We welcome contributions! See CONTRIBUTING.md.

Quick start:

git checkout -b feature/your-feature
cd packages/engine
pnpm test:watch
# Make changes
git commit -m "feat(engine): your feature"
git push origin feature/your-feature
# Create PR

πŸ”— Links

πŸ“„ License

MIT License - Free for personal and commercial use

βš–οΈ Third-Party Components & Assets

Feather Icons

This project includes icons from Feather Icons, created by Cole Bemis and contributors.

  • License: MIT License
  • Version: 4.29.0
  • Available icons: 287
  • Repository: https://github.com/feathericons/feather
  • Location in project: packages/engine/src/renderer/icons/
  • Complete list: docs/ICONS-GUIDE.md
  • Full details: See packages/engine/src/renderer/icons/ICONS-LICENSE.md

Feather Icons are used under the terms of the MIT License, which is fully compatible with this project's MIT License.

✨ Why WireDSL vs Mermaid/Excalidraw/Figma/v0?

Aspect WireDSL Mermaid Excalidraw Figma v0 by Vercel
Purpose βœ… Wireframe ideas ❌ Diagrams βœ… Sketches 🎨 Design system ❌ Production code
UI/UX focused βœ… 30+ UI components ❌ Diagrams only βœ… Visual sketches βœ… Full design βœ… React apps
Code-first βœ… Full DSL βœ… Limited syntax ❌ GUI-only ❌ GUI-only ❌ GUI/prompt
Layout model βœ… Declarative containers (Stack, Grid, Panel) ❌ N/A ❌ Pixel-based ❌ Absolute positioning βœ… HTML-like
AI-generation ready βœ… Predictable syntax ⚠️ Works OK ❌ Not designed for AI ⚠️ Limited βœ… LLM-powered
Version control friendly βœ… Text diffs work great βœ… Text-based ❌ Binary format ❌ Binary format ❌ Code files
Export formats βœ… SVG, PNG, PDF ❌ Limited βœ… SVG, PNG βœ… Multiple ❌ React code
License & Pricing βœ… Open Source (MIT) βœ… Open Source (MIT) βœ… Open Source (MIT) ❌ Paid plans ⚠️ Free tier limited

TL;DR:

  • WireDSL: Wireframe ideas in code (fast ideation + brainstorming)
  • v0: Production React apps from AI (fully coded, ready to deploy)
  • Figma: Design system & collaboration (professional design tool)
  • Mermaid: Diagrams as code
  • Excalidraw: Hand-drawn sketches

πŸ™ Acknowledgments

Inspired by:

  • Mermaid - Diagrams as code
  • Figma - Design systems
  • React - Component-based UIs
  • DSL design patterns - Language engineering

πŸ“ˆ Roadmap

β†’ Full Roadmap Details

Phase 1 βœ… (Completed)

  • βœ… Parser implementation
  • βœ… IR generator
  • βœ… Layout engine
  • βœ… SVG renderer
  • βœ… Web editor MVP
  • βœ… CLI tool
  • βœ… PNG/PDF export

Phase 2 βœ… (Completed)

  • βœ… Style system with design tokens
  • βœ… 23+ built-in components
  • βœ… Component composition & validation
  • βœ… Complete documentation

Phase 3 βœ… (Completed)

  • βœ… VS Code extension with syntax highlighting
  • βœ… Real-time error detection
  • βœ… Component intellisense
  • βœ… Document formatting
  • βœ… Live preview pane
  • πŸ”— GitHub Repository | VS Code Marketplace

Phase 4 πŸš€ (Current)

  • Source maps - Map .wire source to rendered components
  • LSP (Language Server Protocol) support
  • Enhanced debugging capabilities

Future Features

  • Code generation (React/Vue templates)
  • Figma import/export
  • Real-time collaboration
  • ...and more exciting features in the pipeline! πŸŽ‰

πŸ‘₯ Status

βœ… Phase 1: Core MVP (completed)
βœ… Phase 2:  System & Design Tokens (completed)
βœ… Phase 3: VS Code Extension (completed)

πŸš€ Phase 4: Source Maps (in progress)
   β”œβ”€ Source map generation
   β”œβ”€ Debugging support
   └─ Error reporting with precise locations

πŸ“… LSP support (planned)
πŸ“… Code generation (planned)
πŸ“… More features in the pipeline πŸŽ‰

Last Updated: February 6, 2026
Status: βœ… Production-Ready, Open Source
Next: Visit live.wire-dsl.org to try it now!

About

WireDSL - Wireframes as Code. Declarative wireframing with AI-powered generation.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors