Skip to content
Back to skills

Inertia Frontend

ASecurity

Builds Inertia v3, React, TypeScript, and Tailwind frontend pages and forms in a Laravel for Rust application. Use when creating or editing files under resources/js/, resources/css/, resources/views/, or wiring Inertia responses and shared props.

  • 8 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
developmenttypescriptrustphpreacttestingapifrontendbackend

Works with

  • cli
  • api

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add danielhe4rt/overthinking-canvas-rs --skill inertia-frontend --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Inertia Frontend?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Inertia Frontend
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/danielhe4rt-inertia-frontend/badge)](https://www.skillsdirectory.com/skills/danielhe4rt-inertia-frontend)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: inertia-frontend
description: Builds Inertia v3, React, TypeScript, and Tailwind frontend pages and forms in a Laravel for Rust 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-rust-apps/scripts/docs-path.sh`) for Laravel for Rust'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 Rust 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.
- `src/http/middleware/handle_inertia_requests.rs` — Shared props, root view, error page, and asset versioning.

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", props! { ... })`. Inertia routes must run `HandleInertiaRequests` (registered on the `web` middleware group in `src/app.rs`).
- Pass only the props the page needs—avoid dumping sensitive columns (like password hashes or tokens) into serialized props.
- Use `HandleInertiaRequests::share` 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 `Redirect::with` before Inertia middleware runs. See `inertia.md#expired-pages` in the installed docs for that pattern.
- Return `redirect!(...)` or `Redirect::to(...)` 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 Rust `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 Rust 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
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.