Skip to content
v1Zero UI libraries, 210 hand-drawn icons, ready for AI agents

Laravel Inertia FormsBuild Inertia forms in PHP.

Define fields, layout and validation in one Laravel class. Render it in Vue, React or Svelte with a single component, with custom pickers, conditional fields and server validation built in.

erag/inertia-formscomposer

Works with Laravel 13 Inertia 3 Vue 3.5 React 19 Svelte 5 Tailwind CSS 4

Live demo

Try a real form right here

These forms come from PHP classes and render with the Vue component. Switch forms, change the accent color, and submit to see the data.

Form class

Accent
EventSessionForm.php

Open the full demo and the PHP source →

Features

Forms without the wiring

Stop repeating labels, inputs, rules, and error handling in two places. One PHP class drives the page and the validation.

1PHP class per form
22Built-in fields
3Frontend frameworks
13Visibility operators
ONE CLASS

Forms in PHP

Fields, fieldsets, the submit route, and validation live together in a form class you can reuse and test.

VUE REACT SVELTE

One component

Render the whole form with <Form>. The same PHP class works with Vue, React, and Svelte packages.

RULES FROM FIELDS

Validation built in

required(), email(), options, and file types become Laravel rules. Validate with #[Validate].

VISIBLEWHEN

Conditional fields

Show fields based on other values. Hidden fields are skipped by validation, so the browser and server agree.

AUTHORIZEDWHEN

Authorization

Remove fields, fieldsets, or a whole form for users who should not see them. Their rules disappear too.

BIND()

Model binding

Fill edit forms from an Eloquent model or array, including nested paths, dates, enums, and booleans.

MULTIPART

File uploads

Drag and drop, image previews, size and type rules. Update forms with files are sent the way Laravel expects.

COLUMNS

Fieldsets and grids

Group fields with legends and descriptions, lay them out in columns, and span wide fields across the row.

SEARCHABLE

Combobox and search

One dropdown for single and multiple values, with local search or options loaded from the server, fed by arrays, collections, or enums.

TAILWIND 4

Styled and themeable

Clean Tailwind CSS 4 classes with dark mode. Add your own classes to fields, fieldsets, and the form.

YOUR COMPONENTS

Custom fields

Add a PHP field class and register its Vue, React, or Svelte component. It gets labels, errors, and layout for free.

A11Y

Accessible by default

Labels, aria attributes, keyboard support, and focus moves to the first error after a failed submit.

Laravel Boost + AI agents

Your AI agent already knows the form API.

The package ships Laravel Boost guidelines and a skill. After php artisan boost:install, your agent knows the form class, so “an edit profile form with an avatar” comes back as one PHP class, not a page of inputs, state and error handling.

Less code to generate

A form is a short list of fields. That is less for an agent to write and less for you to review, and validation comes with it.

Docs written for agents too

Every page has a Markdown version and llms.txt lists them all, so agents read the real API instead of guessing.

Laravel BoostClaude CodeCursorCodexGemini CLIGitHub Copilot

A prompt card above a PHP form class, next to the form it renders
Shared core

Written once. Rendered three ways.

Visibility rules, dates and times, the combobox search, wizard steps, file handling and every Tailwind class live in one TypeScript core. The Vue, React and Svelte packages are thin renderers on top of it, so a form behaves the same in each.

0runtime dependenciesOnly Inertia and your framework, as peers.
0UI kitsEvery control is built from plain elements.
0icon libraries210 icons drawn for the package.
0date librariesCalendar and time math live in the core.
Vue, React and Svelte renderers floating above one shared core

Nothing underneath. Every control is ours.

  • Headless UI
  • Radix
  • Reka UI
  • Bits UI
  • React Aria
  • Floating UI
  • Popper.js
  • VueUse
  • date-fns
  • Day.js
  • Flatpickr
  • Lucide
Sponsors

Backed by our sponsors

Inertia Forms is free and open source. Sponsors keep it maintained, documented and growing.

Featured sponsor

Building a SaaS? Start with SaaS Laravel.

Production-ready, multi-tenant starter kits for Laravel 13 and Inertia 3, in Vue, React or Svelte. Tenancy, sign-in with passkeys and two-factor, roles, translations and an admin dashboard come ready, so you start on your own product on day one.

  • Multi-tenancy, a database per tenant
  • Passkeys and two-factor sign-in
  • Roles and permissions
  • 17 languages
  • Per-domain branding
  • Admin dashboard
Your company hereSupport the project and reach Laravel developers building with Inertia.
Become a sponsor
Workflow

From a PHP class to
a working form

You describe the form once. Laravel turns it into a JSON schema for the page, the frontend renders it, and the same class validates the submission.

1

Define the form

Run php artisan make:form and list your fields, fieldsets, and route.

2

Pass it to the page

Send CreateUserForm::make() as an Inertia prop and render it with <Form>.

3

Validate on submit

Type-hint the form with #[Validate] and use $form->validated().

Server-driven forms for Inertia apps

Laravel Inertia Forms is an open-source package for building forms in Laravel and Inertia.js applications. Instead of writing the same labels, inputs, validation rules, and error messages in a controller and again in a Vue, React, or Svelte page, you describe the form once in a PHP class. The package serializes that class into a schema, renders it with one component styled with Tailwind CSS 4, handles conditional fields and file uploads, and validates the request with the same rules on the server.

Frequently Asked Questions

Common questions about Laravel Inertia Forms, validation, frontends, and customization.

Which frameworks and versions are supported?

Laravel 13 with Inertia 3 and PHP 8.3+. On the frontend, pick the package for your stack: @erag/inertia-forms-vue (Vue 3.5+), @erag/inertia-forms-react (React 19), or @erag/inertia-forms-svelte (Svelte 5). Styling uses Tailwind CSS 4.

Do I still write validation rules?

Most rules are generated from the field setup, like required(), email(), maxLength(), option lists, and file types. Add anything else with ->rule() or ->rules(), for example unique:users,email. Validate with the #[Validate] attribute or $form->validate($request).

What happens to fields that are hidden by visibleWhen()?

They are removed from the page in the browser and skipped during validation, so a hidden required field never blocks a submission and its value is left out of validated(). Add clearWhenHidden() to reset the value when the field disappears.

Can I use it for edit forms?

Yes. Call ->bind($model) to fill the form from an Eloquent model or an array, and point it at an update route with ->route('users.update', $user). The HTTP method is read from the route.

How do I add my own field type?

Create a PHP class that extends Field and returns a component name, then register a matching component on <Form> with the components prop. Your component receives the field, its value, and its error, and is wrapped with the label and help text automatically.

Can I change the look of the form?

Yes. Every field, fieldset, and the form accept extra CSS classes, and dark mode follows Tailwind's dark: variant. Point Tailwind at the package with one @source line so its classes are generated.

How do I install it?

Install the Laravel package and the frontend package for your stack:

Backendcomposer require erag/inertia-forms
Frontendnpm install @erag/inertia-forms-vue

Use @erag/inertia-forms-react or @erag/inertia-forms-svelte for React or Svelte, then follow the Quick Start.