Fast Draft
What You GetInstall this extension and every
Features🎨 Syntax HighlightingRich TextMate-based syntax highlighting for
✅ Live Parser ValidationReal-time error detection as you type:
🖼️ Interactive CanvasA live-rendering canvas powered by Rust/WASM:
🌳 Tree PreviewView the parsed scene graph as a structural tree:
Interactive Usage Guide1. Create a new
|
| Key | Tool | Action |
|---|---|---|
V |
Select | Click to select, drag to move |
R |
Rect | Click + drag to draw rectangles |
Cmd+Z |
Undo | Undo last action |
Cmd+Shift+Z |
Redo | Redo last undone action |
When you draw a rectangle on canvas, the corresponding FD code is automatically generated in the text editor.
4. Inspect the Scene Graph
Open Command Palette → FD: Show Tree Preview to see:
Scene Graph
├── style accent
├── group @login_form
│ ├── text @title "Welcome Back"
│ ├── rect @email_field
│ │ └── text @email_hint "Email"
│ ├── rect @pass_field
│ │ └── text @pass_hint "Password"
│ └── rect @login_btn
│ └── text @btn_label "Sign In"
└── @login_form → center_in: canvas
5. Catch Errors Instantly
Try typing an invalid color:
rect @broken {
fill: #GGG # ← red squiggle: "Invalid hex color"
w: 100 h: 50
↑ Missing } — the Problems panel shows: "1 unclosed brace(s)"
Example: Login Form
# FD v1
# A login form mockup
style base_text {
font: "Inter" 14
fill: [#333333](https://github.com/khangnghiem/fast-draft/issues/333333)
}
style accent {
fill: #6C5CE7
}
group @login_form {
layout: column gap=16 pad=32
text @title "Welcome Back" {
use: base_text
font: "Inter" 600 24
fill: #1A1A2E
}
rect @email_field {
w: 280 h: 44
corner: 8
stroke: #DDDDDD 1
text @email_hint "Email" {
use: base_text
fill: [#999999](https://github.com/khangnghiem/fast-draft/issues/999999)
}
}
rect @login_btn {
w: 280 h: 48
corner: 10
use: accent
text @btn_label "Sign In" {
font: "Inter" 600 16
fill: #FFFFFF
}
anim :hover {
fill: #5A4BD1
scale: 1.02
ease: spring 300ms
}
}
}
@login_form -> center_in: canvas
What this produces:
- A vertical card with 16px gap between elements
- A title, email input field, and a purple Sign In button
- The button has a hover animation (color shift + subtle scale)
- The entire form is centered on the canvas
Why FD?
| vs. SVG | vs. Figma | vs. HTML/CSS |
|---|---|---|
| 5× fewer tokens — AI can generate it faster | Code-first — version control, diffs, PRs | Semantic — center_in: canvas not margin: 0 auto |
| Constraint-based — no absolute coords | Open format — no vendor lock-in | GPU-rendered — Vello/wgpu pipeline |
| Bidirectional — edit code or canvas | Extensible — custom nodes, styles, animations | WASM — same renderer on web, desktop, mobile |
Requirements
- VS Code ≥ 1.85.0
Links
License
MIT