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 litestar import Litestar, get
from litestar_vite import ViteConfig, VitePlugin

@get("/", component="Home")
async def home() -> dict:
    return {"message": "Hello, World!"}

app = Litestar(
    route_handlers=[home],
    plugins=[
        VitePlugin(config=ViteConfig(dev_mode=True, inertia=True)),
    ],
)

Getting Started

Core Concepts