Inertia.js¶
Build modern single-page applications with server-side routing using Inertia.js.
See also
Official Inertia.js docs: Getting Started
Inertia.js is a protocol that lets you build SPAs without building an API. Your Litestar routes return page components directly, and Inertia handles the rest - routing, navigation, and state management.
Tip
See litestar-fullstack-inertia for a complete production example.
Quick Example¶
from typing import Any
from litestar import Litestar, get
from litestar_vite import ViteConfig, VitePlugin
@get("/", component="Home")
async def home() -> dict[str, Any]:
return {"message": "Hello, World!"}
app = Litestar(
route_handlers=[home],
plugins=[
VitePlugin(config=ViteConfig(dev_mode=True, inertia=True)),
],
)
Getting Started
Core Concepts
Data & Props
Advanced
TypeScript Integration
Examples
See Also¶
Installation - Set up Inertia with Litestar
How It Works - Protocol and request lifecycle overview