Builds Inertia v3, React, TypeScript, and Tailwind frontend pages and forms in a Laravel for Go application. Use when creating or editing files under resources/js/, resources/css/, resources/views/, or wiring Inertia responses and shared props.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Inertia Frontend?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/airshell-inertia-frontend-laravel-php-to-rust-go)
---
name: inertia-frontend
description: Builds Inertia v3, React, TypeScript, and Tailwind frontend pages and forms in a Laravel for Go application. Use when creating or editing files under resources/js/, resources/css/, resources/views/, or wiring Inertia responses and shared props.
---
# Inertia Frontend (React + TypeScript + Vite Plus)
Consult `<docs>/inertia.md` (via `.agents/skills/writing-laravel-go-apps/scripts/docs-path.sh`) for Laravel for Go's server-side Inertia integration (rendering, deferred/live props, flash data, error pages, SSR, and testing). For client-side Inertia v3 APIs (`@inertiajs/react`, `<Form>`, `useForm`, persistent layouts, manual visits, scroll management), you can also consult the official Inertia docs at https://inertiajs.com/docs/v3—just note that server-side examples there are written in Laravel PHP, so always check the installed `<docs>/inertia.md` for the Go API.
## Layout
- `resources/js/app.tsx` — Inertia client entry point.
- `resources/js/pages/` — Page components matching `inertia.Render("Posts/Index", ...)` → `resources/js/pages/Posts/Index.tsx`.
- `resources/js/pages/Error.tsx` — Custom Inertia error page.
- `resources/views/app.html` — Root HTML template.
- `resources/css/app.css` — Tailwind CSS v4 entry point.
- `bootstrap/app.go` — `inertia.Middleware` configuration, shared props (`share`), and error page.
Put reusable components in `resources/js/components/`, layouts in `resources/js/layouts/`, and shared types in `resources/js/types/`. Keep types used by only one page in the page file.
## Backend-to-Frontend Conventions
- Render pages from `web` routes using `inertia.Render("Resource/Page", inertia.Props{...})`. Inertia routes must run `inertia.Middleware` (registered on the `web` middleware group in `bootstrap/app.go`).
- Pass only the props the page needs—avoid exposing sensitive fields (mark secret model fields with `json:"-"`).
- Use the `Share` function on `inertia.Middleware` in `bootstrap/app.go` for shared props, such as an authenticated user summary or the app name.
- For a one-time message after a form submission, call `inertia.Flash` before returning the redirect. Read the message from `usePage().flash` and check its type before rendering it, for example with `typeof toast === 'string'`.
- The starter's `props.status` comes from session flash, such as a notice set with `With` on an expired-page redirect. See `inertia.md#expired-pages` in the installed docs for that pattern.
- Return `web.Redirect(...)` or `web.RedirectRoute(...)` after `POST`/`PUT`/`PATCH`/`DELETE` handlers so Inertia follows the redirect cleanly. Validation errors automatically redirect back with errors attached to the form.
## React, Inertia v3 & Tailwind v4 Conventions
- Type every page component's props explicitly to match the Go `inertia.Props{...}` payload.
- Always use Inertia's `<Link>` component (not `<a>` tags) for internal links so navigation stays client-side.
- Prefer Inertia's `<Form>` component from `@inertiajs/react` for form submissions (it handles CSRF, validation errors, `processing`, and resets cleanly). Use `useForm` only when you need programmatic control, and never submit raw `<form>` elements without Inertia.
- Always handle the initial `undefined` state with a loading or skeleton state when rendering deferred props.
- Configure Tailwind CSS v4 theme tokens in `resources/css/app.css` with `@import "tailwindcss";` and `@theme` (do not create a `tailwind.config.js`). Avoid deprecated v3 utilities (`bg-opacity-*` → `bg-blue-500/50`, `flex-shrink-*` → `shrink-*`, `flex-grow-*` → `grow-*`), prefer `gap-*` over margins for spacing between siblings, and match existing `dark:` variants if the app supports dark mode.
- If SSR is enabled, keep initial server and client renders identical—pass timestamps, locale, or random values from Go props, or initialize browser-only state inside `useEffect`.
- If frontend changes aren't appearing or you hit a Vite manifest error, run `npm run build` (or ensure `npm run dev` is running).
## Verification Commands
```sh
npm run types:check # TypeScript typecheck (tsc --noEmit)
npm run check # Vite Plus lint/format check
npm run build # Production frontend build
npm run build:ssr # Production client + SSR build
```