Documentation Index
Fetch the complete documentation index at: https://kawax.biz/llms.txt
Use this file to discover all available pages before exploring further.
What is Inertia.js?
You want a React or Vue frontend. You don’t want to design, build, and maintain a separate REST API. Inertia.js solves exactly that problem. Inertia is not a framework. It’s an adapter layer that connects your existing Laravel backend to a JavaScript frontend. You keep Laravel’s routing, controllers, and middleware. Your views become React, Vue, or Svelte components. Page navigation happens over XHR instead of full reloads, giving you SPA-like fluidity without the API overhead.Inertia v3 was released on March 26, 2026. Laravel 13 starter kits for React, Vue, and Svelte all use Inertia.
Inertia vs. traditional approaches
| Architecture | Strengths | Trade-offs |
|---|---|---|
| Blade (MPA) | Simple, tight Laravel integration | Full page reload on every navigation |
| Separate SPA + API | High interactivity | API design, authentication, and type definitions duplicated |
| Inertia (modern monolith) | SPA UX + server-side simplicity | Some learning curve |
Getting started with a starter kit
The fastest way to use Inertia is through a Laravel starter kit. When you runlaravel new, choose React, Vue, or Svelte:
inertiajs/inertia-laravel(server-side adapter)@inertiajs/react,@inertiajs/vue3, or@inertiajs/svelte(client adapter)- The
HandleInertiaRequestsmiddleware - Authentication screens (login, register, password reset) already implemented as Inertia page components
Inertia::render() — the core API
Return an Inertia response from any controller using Inertia::render(). The first argument is the JavaScript component name; the second is the data passed as props.
'Posts/Index' maps to a file path. For React that’s resources/js/Pages/Posts/Index.jsx; for Vue it’s resources/js/Pages/Posts/Index.vue.
Page components
An Inertia page component is a standard React or Vue component. Props from the controller arrive automatically.React
Vue
<Link> component instead of <a> tags. Inertia intercepts the click, fetches only the new component over XHR, and swaps it in — no full page reload.
Shared data — HandleInertiaRequests
Data needed on every page (the authenticated user, flash messages, app config) belongs in the share() method of the HandleInertiaRequests middleware.
React
Shared data is included in every request, so keep it minimal. Wrap expensive data in a closure for lazy evaluation — it will only run when the response is actually sent.
Form handling and validation errors
Inertia’suseForm() helper manages form state, submission, and error display in one place. Laravel’s built-in validation integrates automatically.
Controller
errors prop to the page component.
Frontend
React
Vue
useForm() preserves the user’s input and displays the error messages — no re-entering data, better user experience.
What’s new in Inertia v3
Inertia v3 shipped on March 26, 2026. Here are the key changes from v2.Axios removed — lighter built-in XHR client
v3 removes the Axios dependency and replaces it with a lighter built-in XHR client. Most applications require no code changes. Axios interceptors migrate directly to the built-in interceptor API. If you need Axios specifically, an Axios adapter is available.SSR simplified with @inertiajs/vite
The new Vite plugin handles automatic page component resolution and SSR configuration. Running SSR in development now requires only npm run dev — no separate Node server to start.
useHttp — HTTP requests without page navigation
The new useHttp hook sends HTTP requests to the server without triggering an Inertia visit (page transition). Use it for modal saves, background updates, or any case where you want to communicate with the server while staying on the current page.
Optimistic UI updates
useForm and the router now support optimistic updates. The UI updates immediately on user action; if the server returns an error, Inertia rolls back the change automatically.
Layout props
The newuseLayoutProps hook lets a page component pass data to its persistent layout. Previously, sharing page-specific state with a layout required shared data or extra props threading.
Minimum version requirements
| Dependency | v2 | v3 |
|---|---|---|
| PHP | 8.1+ | 8.2+ |
| Laravel | 10+ | 11+ |
| React | 18+ | 19+ |
| Svelte | 4+ | 5+ |
Inertia::lazy() removed
Inertia::lazy(), deprecated in v2, is removed in v3. Use Inertia::optional() instead.
Event name changes
| v2 | v3 |
|---|---|
invalid | httpException |
exception | networkError |
For the full v2 → v3 upgrade steps, see the official upgrade guide. v2 receives bug fixes until September 26, 2026, and security fixes until March 26, 2027.
When to use Inertia
Good fits
- Teams already familiar with Laravel who want a React or Vue frontend
- Applications that centralize authentication, authorization, and validation in Laravel
- Admin panels and internal tools where SEO is not a priority
- Projects where maintaining a separate API would add significant overhead
Less suited for
- Applications where multiple clients (mobile apps, third-party integrations) share the same API
- Content sites where SEO is critical (SSR is supported but adds complexity)
- Projects where the frontend team operates completely independently of the backend
Inertia vs. Livewire
Both Inertia and Livewire address the same underlying problem — dynamic UIs in Laravel — but from opposite directions.- Livewire keeps everything in PHP and Blade. No JavaScript framework is involved; your team writes PHP.
- Inertia lets your team write React, Vue, or Svelte on the frontend while keeping Laravel on the backend. It assumes comfort with a JavaScript framework.
Inertia.js documentation
Full reference for Inertia v3, including SSR, the Vite plugin, and the upgrade guide.