Getting Started with Webui
Learn how to set up, configure, and build your first application with Webui. This guide covers installation, project structure, core concepts, and best practices for production-ready development.
Installation
Webui supports multiple package managers and works seamlessly with modern JavaScript ecosystems. Run the following command to scaffold a new project:
Project Structure
Webui follows a conventional directory structure that makes your codebase predictable and scalable:
Core Concepts
Understanding these four pillars will help you build efficient and maintainable applications:
⚡ File-Based Routing
Routes are automatically generated from your pages/ directory structure. No manual router configuration needed.
🧩 Composable Components
Build UI with a slot-based architecture. Components are framework-agnostic and highly customizable.
🎨 Design Tokens
Centralized styling system with CSS variables, dark mode support, and theme inheritance out of the box.
🌍 Edge-Ready Deploy
Optimized builds for Vercel, Netlify, Cloudflare, and Docker. Auto-split chunks and tree-shaking included.
Quick Example
Here's how you create a responsive dashboard layout using Webui's built-in primitives:
webui generate component to scaffold new UI blocks with automatic imports, type definitions, and accessibility attributes pre-configured.
Best Practices
- Keep components small — Aim for single-responsibility components under 150 lines.
- Lazy load routes — Use dynamic imports to reduce initial bundle size.
- Leverage design tokens — Avoid hardcoded styles; use the centralized theme system.
- Type your props — Webui ships with full TypeScript definitions. Enable
strict: truein your config. - Test interactions — Use the built-in
@webui/testutilities for snapshot and behavior testing.
useTransition or Suspense boundaries to prevent hydration mismatches.
What's Next?
You're now ready to build! Explore the following guides to dive deeper into Webui's capabilities:
- Routing & Nested Layouts — Master file-based routing and dynamic segments
- Styling & Theming — Configure design tokens and dark mode
- Deployment — Ship to Vercel, Netlify, or self-hosted Docker