Framework Examples

Litestar Vite supports a wide variety of frontend frameworks. This section provides working examples for each supported framework.

React

React 18+ with Vite

React
Vue

Vue 3 with Composition API

Vue
Svelte

Svelte 5 with Vite

Svelte
Angular

Angular 18+ (Vite or CLI)

Angular
Inertia.js

SPAs with server-side routing

Inertia.js
HTMX

Hypermedia-driven applications

HTMX

Quick Scaffold

Use the CLI to scaffold any framework:

# React
litestar assets init --template react

# Vue
litestar assets init --template vue

# Svelte
litestar assets init --template svelte

# Angular (Vite-based)
litestar assets init --template angular

# HTMX
litestar assets init --template htmx

# With Inertia.js
litestar assets init --template react-inertia
litestar assets init --template vue-inertia
litestar assets init --template svelte-inertia

Framework Comparison

Framework

Source Dir

Dev Server

Inertia Support

Best For

React

src/

Vite + HMR

Yes

SPAs, complex UIs

Vue

src/

Vite + HMR

Yes

SPAs, progressive enhancement

Svelte

src/

Vite + HMR

Yes

Lightweight SPAs

Angular

src/

Vite (Analog)

No

Enterprise apps

Angular CLI

src/

ng serve

No

Standard Angular workflow

HTMX

src/

Vite + HMR

No

Server-rendered, minimal JS