UI & surfaces
UI is declared as components with state, methods, and a view tree. Product kind decides the surface.
| kind | Surface | Notes |
|---|---|---|
desktop | Native window | eframe/egui |
web | Browser via localhost | HTML preview |
mobile | Native window | Mobile-first layout |
backend | None | Services only |
Web = browser
CLI prints “Opening web app in your browser…” and binds
127.0.0.1 (5173 / 3000 / 8080…). Press Ctrl+C to stop.
Component syntax
component HomePage {
state title = "Home"
state count = 0
fn inc() {
count = count + 1
}
view {
Column {
Text(title)
Text(count)
Button("Inc", onClick: inc)
}
}
}UI only
vampcode run app/page.vamp
Web opens a desktop app?
Ensure
kind = "web" in vamp.toml, create with --type web, and update the CLI.