Running WebATUI Examples
Quick reference for running the example applications.
Terminal Examples
Basic Example
cargo run --example basicMinimal “Hello World” demonstrating core webatui patterns.
Dashboard Example
cargo run --example dashboardFull-featured dashboard with multiple widgets, charts, and tabs.
Interactive Example
cargo run --example interactiveInteractive demo showing buttons, lists, focus management, and state updates.
Web Example
Development Server
# Install trunk (one-time setup)
cargo install trunk
# Run development server with hot reload
trunk serve --features webThen open http://localhost:8080 in your browser.
Production Build
# Install wasm-pack (one-time setup)
cargo install wasm-pack
# Build optimized WASM bundle
wasm-pack build --target web --features web --release
# Serve the built files (use any static server)
python3 -m http.server 8000Then open http://localhost:8000 in your browser.
Example Features Comparison
| Feature | basic | dashboard | interactive | web_demo |
|---|---|---|---|---|
| Lines of Code | ~140 | ~312 | ~385 | ~237 |
| Keyboard Input | ✓ | ✓ | ✓ | - |
| Mouse/Click | - | - | - | ✓ |
| State Management | ✓ | ✓ | ✓ | ✓ |
| Multi-Component | - | ✓ | ✓ | ✓ |
| Tab Navigation | - | ✓ | ✓ | ✓ |
| Lists | - | ✓ | ✓ | ✓ |
| Charts | - | ✓ | - | - |
| Gauges | - | ✓ | - | - |
| Buttons | - | - | ✓ | ✓ |
| Focus Management | - | - | ✓ | - |
| Web Deployment | - | - | - | ✓ |
Quick Tips
Terminal Examples:
- Press
qorEscto quit any terminal example - All examples support terminal resizing
- Minimum recommended terminal size: 80x24
Web Example:
- Use trunk for development (hot reload)
- Use wasm-pack for production builds
- Check browser console for errors
- Requires modern browser with WASM support
See Also
- README.md - Detailed example documentation
- index.html - Web demo styling and structure
- Cargo.toml - Example configurations