Skip to content
v0.0.3New: translate every form into any language

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.

composer require 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
Prompts

Give a prompt. Get a working form.

Tell your coding agent what you need in plain words. It plans the work, writes the form class, controller and page, runs the tests and tells you what it added. Run php artisan boost:install once so Claude Code, Codex, Cursor and other agents know the form API.

~/laravel-app · AI coding agent

Add a contact form at /contact with name, email and message. Validate it on the server and save every message.
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

Quick answers to the things people ask most before they try Laravel Inertia Forms.

What is Laravel Inertia Forms?

It's a free Laravel package that saves you from writing the same form over and over. You write the form once in PHP: which fields it has, how they're laid out and what the rules are. Then you show it on your Vue, React or Svelte page with a single component. When someone submits it, the same PHP class checks the data.

Is it free to use?

Yes, completely. It's open source under the MIT license, so you can use it in your own projects and in client or commercial work without paying anything.

Which versions of Laravel and Inertia does it work with?

You need Laravel 13, Inertia 3 and PHP 8.3 or newer. For the frontend, it works with Vue 3.5, React 19 and Svelte 5, and the styling is done with Tailwind CSS 4.

How do I install it?

You install two things: the Laravel package with Composer, and the package for your frontend (Vue, React or Svelte) with npm. After that you add one line to your CSS file so Tailwind picks up the styles. It takes a few minutes, and the installation guide and quick start walk you through it.

Do I need to write my validation rules twice?

No, and that's one of the main reasons the package exists. When you mark a field as required, as an email, or give it a maximum length, the rule is added for you. You can still add any extra Laravel rule you like. The form checks the data on the server, and any errors show up right under the field that caused them.

Can a field show up only when it's needed?

Yes. For example, you can show a "Company name" field only when someone ticks "I'm buying for a company". Fields that are hidden aren't checked and aren't saved, so a hidden required field will never stop someone from submitting. Read more in conditional visibility.

Can I use the same form for creating and editing?

Yes. On the edit page you pass in the record, for example the user being edited, and the form opens with their current details already filled in. You don't need a second form for editing. See model binding.

Can I split a long form into steps?

Yes. Long forms like sign-ups or onboarding can be shown as steps, with a progress bar and Back and Continue buttons. Each step is checked before the person can move on, so they fix mistakes as they go instead of all at the end. See wizard forms.

Can people upload files and images?

Yes. People can drag and drop files or click to pick them, see a preview of images, and upload more than one file if you allow it. You decide the allowed file types and the maximum size. See file upload.

What kinds of fields can I use?

There are 22 ready-made fields. You get the usual ones like text, textarea, select, radio buttons, checkboxes and toggles, plus date and time pickers, a color picker, a slider, file uploads and tags. For bigger forms there are repeating rows, content blocks, links, slugs, one-time codes and even a chat-style message box.

Can my forms be shown in other languages?

Yes. Your own labels use Laravel's normal translation files, just like the rest of your app. The text that comes with the package, like button labels, placeholders and the month names in the calendar, can be translated too, and it switches as soon as the user changes language. See translations.

Can I make the forms match my design?

Yes. You can add your own CSS classes to any field or section, change the main accent color, put fields side by side in columns, and dark mode works on its own. See styling.

What if I need a field that isn't included?

You can build your own. You make a small PHP class for the field and a matching component for your frontend, and the package takes care of the label, help text and error message for you, just like it does for the built-in fields. See custom fields.

Do I need to install other UI or date libraries?

No. The dropdowns, calendar, time picker, color picker and upload box are all part of the package. Apart from Inertia and the framework you already use, there's nothing else to install, and it even comes with its own icons.

Are the forms accessible?

Yes, we care about this a lot. Every field has a proper label, screen readers announce errors, the pickers can be used with just a keyboard, and after a failed submit the cursor jumps straight to the first mistake.

Can AI tools like Claude Code or Cursor build forms with it?

Yes. The package comes with instructions for Laravel Boost, so tools like Claude Code, Cursor, Codex and GitHub Copilot know how to use it properly instead of guessing. You can simply describe the form you want in plain words. See the example agent sessions above.

Why not just write Inertia forms by hand?

You can, but it gets repetitive fast. Every hand-written form needs its inputs, its state, its error messages and its validation rules, often spread over a few files. With this package a form is one short PHP class, so there's less to write, less to test, and all your forms look and work the same way.