Skip to content

Installation ​

This guide shows the shared Laravel setup once, followed by the Vue and React frontend setup side by side. You install the Composer package once, then choose the frontend package that matches your app.

Composer Authentication ​

Installing Inertia Forms requires a valid license. Your license key is available in the Inertia UI portal, where you may also purchase one.

Inertia Forms is distributed through the Inertia UI Composer repository. Add the repository to your composer.json file:

json
"repositories": [
    {
        "type": "composer",
        "url": "https://satis.inertiaui.com"
    }
]

Next, authenticate with your Inertia UI email address and license key:

bash
composer config --global --auth http-basic.satis.inertiaui.com "your-email-address" "your-license-key"
json
{
    "http-basic": {
        "satis.inertiaui.com": {
            "username": "your-email-address",
            "password": "your-license-key"
        }
    }
}
bash
composer config http-basic.satis.inertiaui.com "your-email-address" "your-license-key"
text
Open your server in Forge, go to Composer Package Authentication,
and add satis.inertiaui.com as the repository URL with your email
and license key. No command needed.

The Local command stores the credentials in ~/.composer/auth.json on your machine. In a team project, you may commit an auth.json file alongside composer.json instead. Never commit it to a public repository.

On Laravel Cloud, add the composer config command to your environment's build commands before composer install. On Laravel Forge, add the credentials on the Composer Package Authentication screen of your server settings.

Composer Package ​

Install Inertia Forms using Composer:

bash
composer require inertiaui/forms

Upload Routes (Optional) ​

The File and Composer fields and RichText::imageUploads() need upload routes for temporary, chunked, or direct-to-storage uploads. Register them in your routes/web.php file before you use any of those uploads:

php
use Illuminate\Support\Facades\Route;

Route::inertiaFormUploads();

This exposes the temporary upload, delete, chunked upload, and direct-to-storage endpoints those fields use. The web and auth middleware protect the routes by default.

You may skip this step when your app never accepts uploads through Inertia Forms. Local storeWithForm() uploads don't use these routes either, because they're submitted with the form request. See File Upload Routes for custom prefixes, middleware, and per-section route groups.

Publish Configuration (Optional) ​

To customize upload defaults or authorization behavior, you may publish the runtime configuration file:

bash
php artisan vendor:publish --tag=inertia-forms-config

See Configuration for the full runtime config reference and File Uploads for choosing an upload transport.

Frontend Package ​

After installing the Composer package, link the frontend package for your stack. This creates a package in node_modules that points to the Vue or React package bundled inside vendor. pnpm requires the file: protocol, as in pnpm add file:..., instead of a plain pnpm install:

bash
npm install vendor/inertiaui/forms/vue
bash
pnpm add file:vendor/inertiaui/forms/vue
bash
npm install vendor/inertiaui/forms/react
bash
pnpm add file:vendor/inertiaui/forms/react

Both frontend packages consume the same serialized PHP form config.

Keep the frontend in sync

Reinstall the frontend package every time you update the Composer package. A new Composer release may include new bundled Vue or React assets, and those only reach node_modules once you rerun npm or pnpm for the linked package.

Styles ​

Import the package theme tokens and component styles from your application CSS. Then use the @source directive so Tailwind scans the source files shipped in the Composer package:

css
@import "tailwindcss";
@import "@inertiaui/form-vue/theme.css";
@import "@inertiaui/form-vue/style.css";

@source "../../vendor/inertiaui/forms/vue/src/**/*.{js,ts,vue}";
css
@import "tailwindcss";
@import "@inertiaui/form-react/theme.css";
@import "@inertiaui/form-react/style.css";

@source "../../vendor/inertiaui/forms/react/src/**/*.{js,jsx,ts,tsx}";

The @source path may differ depending on your project structure. It should point to the Vue or React package source directory inside vendor/inertiaui/forms.

The theme file defines semantic tokens for the generated form UI, and Tailwind turns those tokens into theme utilities. To make the forms match your app, override the tokens in your own CSS. The package also exposes stable CSS hooks for selector-based overrides. See Theme Tokens and Available CSS Hooks for the full reference.

The style.css file carries the component and browser-generated DOM styles that still need CSS outside Tailwind's scanned utilities, so keep both imports for the package you use.

Vite Plugin (Optional) ​

Built-in fields are lazy by default. Without the Vite plugin, the package root export keeps the default lazy registry and loads built-in field components on demand.

Add the optional Vite plugin only when you want selected built-in fields registered eagerly in your app bundle, so they're available immediately on the first render:

js
import { inertiaForms } from '@inertiaui/form-vue/vite'
import vue from '@vitejs/plugin-vue'

export default {
    plugins: [inertiaForms({ eager: true }), vue()],
}
js
import { inertiaForms } from '@inertiaui/form-react/vite'
import react from '@vitejs/plugin-react'

export default {
    plugins: [inertiaForms({ eager: true }), react()],
}

The eager: true option registers every built-in field eagerly:

js
inertiaForms({ eager: true })

To include only specific built-in fields in the eager registry, pass an eager array that lists each field:

js
inertiaForms({ eager: ['TextInput', 'Combobox', 'File'] })

To make most built-in fields eager and keep a few lazy, add an except array. The except option only works with eager: true. RichText is the usual candidate, because it bundles a full editor and is by far the largest built-in field:

js
inertiaForms({ eager: true, except: ['RichText'] })

Field names must match built-in component names, such as TextInput, Combobox, File, or RichText. Unknown names fail the Vite build, so typos are caught before deployment.

Applications that alias the package root to its source should register eager fields manually with registerFieldComponents. Register built-in fields before custom overrides, and finish registration before mounting forms.