Frontend
Frontend freedom
Leaf works with simple PHP views, Blade, BareUI, Vite, Tailwind, Inertia, React, Vue, Svelte, and third-party engines. Your backend stays readable while your UI stack stays yours.
Choose by workflow
Templates
Blade or BareUI when server-rendered pages are enough.
Modern assets
Vite and Tailwind when you want fast local builds and utility styling.
App UIs
Inertia when React, Vue, or Svelte should talk to Leaf directly.
Templating Engines
Leaf is modular and lets you use any templating engine you want. It includes first-class support for two common options:
BareUI relies on PHP's native templating capabilities, so its syntax is just PHP. Blade has its own directive syntax and a larger feature set. Both are valid choices; pick based on how much template power you want.
Asset Bundling
Leaf provides first-class support for asset bundling using Vite. Vite gives modern frontend projects fast development, ES modules, JSX, TypeScript support, and production builds.
The Vite + Leaf stack works well when you want Leaf to own the backend while your frontend code stays modular and easy to build. You can find the full documentation on the Vite module page.
Frontend Frameworks
Modern app interfaces often use React, Vue, or Svelte. Leaf integrates with these through Inertia.js, giving your frontend direct access to Leaf-powered pages without building a separate API for every screen.
AI context
Frontend choices are part of Leaf's shared project context. Agents inside the project read .leaf/CONTEXT.md alongside the filesystem, then keep that map aligned when Blade, BareUI, Vite, Tailwind, or Inertia changes. Run leaf context only to print a compact handoff for an external assistant without project access.
