talira

Inertia.js

Build frontend experiences with the backend you love

open sourceMITself-hostablefree

Inertia.js lets you build single-page apps in React, Vue or Svelte while keeping routing, controllers, auth and data fetching on a server-side framework, with no client-side router and no API to write: a controller returns a page component and its props, and Inertia swaps pages in the browser. It calls itself the modern monolith, and isn't a framework but glue between one on the server and one in the browser, through official adapters for Laravel, Rails, Phoenix and Django (and community ones for others) and for React, Vue and Svelte. Version 3 adds forms with validation and file uploads, partial reloads, deferred and shared props, prefetching, polling, infinite scrolling, server-side rendering and asset versioning. It's tuned for Laravel, whose team maintains it, and is MIT licensed.

Problems it solves

  • build a React or Vue frontend for my Laravel app without writing and maintaining a separate API
  • keep routing, auth and authorization in my backend while the UI feels like a single-page app
  • a modern SPA frontend for a Rails, Django or Phoenix monolith
  • submit forms from Vue or React and show server-side validation errors without a JSON API
  • reload only the data that changed on a page instead of the whole page
  • server-side render my React or Svelte pages for SEO in a Laravel app
  • share the logged-in user and notifications with every page without fetching them on each one
  • prefetch the next page on hover so navigation feels instant

Features

  • server-side routing and controllers render client-side React, Vue or Svelte pages
  • official server adapters for Laravel, Rails, Phoenix and Django; community adapters for others
  • official client adapters for React, Vue and Svelte
  • forms with validation, file uploads and error handling
  • partial reloads, deferred, merged, once and shared props
  • prefetching on hover or click, polling and infinite scrolling
  • server-side rendering
  • automatic asset versioning
  • TypeScript support and DevTools
  • previous major gets bug fixes for 6 months and security fixes for 12, as Laravel does

Capabilities

Takes pluginsplan not known

Alternatives

The same job

These do what Inertia.js does.

  1. React on Rails Integration of React + Webpack + Rails including server-side rendering of React
  2. Hotwire HTML over the wire
  3. htmx High power tools for HTML

Compare Inertia.js with the top 3