inertia

Build modern monolith applications with Inertia.js - combining server-side frameworks (Laravel, Rails, etc.) with React/Vue/Svelte frontends without building APIs. Use when creating Inertia pages and layouts, working with Link component for navigation, building forms with Form component or useForm hook, handling validation and errors, managing shared data and props, implementing authentication and authorization, using manual visits with router, working with partial reloads, setting up persistent layouts, or configuring client-side setup.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "inertia" with this command: npx skills add 1naichii/ai-code-tools/1naichii-ai-code-tools-inertia

Inertia.js

Modern monolith framework for building SPAs without APIs. Combine server-side framework power with React/Vue/Svelte frontends.

Core Concept

Inertia replaces your view layer - controllers return JavaScript page components instead of server-side templates. The <Link> component intercepts clicks for XHR visits, providing SPA experience without full page reloads.

Quick Reference

Basic Page Structure

<script setup>
import Layout from './Layout'
import { Head } from '@inertiajs/vue3'
defineProps({ user: Object })
</script>

<template>
    <Layout>
        <Head title="Welcome" />
        <h1>Welcome {{ user.name }}</h1>
    </Layout>
</template>

Navigation

<Link href="/users">Users</Link>
<Link href="/logout" method="post" as="button">Logout</Link>
<Link href="/search" :data="{ query }" preserve-state>Search</Link>

Form Submission

<!-- Simple Form Component -->
<Form action="/users" method="post">
    <input type="text" name="name" />
    <button type="submit">Create</button>
</Form>

<!-- useForm Hook -->
<script setup>
import { useForm } from '@inertiajs/vue3'
const form = useForm({ name: '', email: '' })
function submit() { form.post('/users') }
</script>

Documentation by Topic

TopicReference FileDescription
Formsforms.mdForm component, useForm helper, validation, error handling
Links & Navigationlinks.mdLink component, manual visits, active states
Validationvalidation.mdServer-side validation, error bags, error display
Pages & Layoutspages-layouts.mdPage components, persistent layouts, default layouts
Data & Propsdata-props.mdShared data, partial reloads, deferred props
Authenticationauthentication.mdAuth patterns, CSRF protection, authorization
Setupsetup.mdClient-side initialization, server-side setup
Advancedadvanced.mdEvents, error handling, scroll management, SSR

Common Patterns

Displaying Validation Errors

<div v-if="errors.email">{{ errors.email }}</div>

Accessing Shared Data

<script setup>
import { usePage } from '@inertiajs/vue3'
const page = usePage()
const user = computed(() => page.props.auth?.user)
</script>

Preserving State/Scroll

<Link href="/form" preserve-state preserve-scroll>Edit</Link>

Partial Reloads

<Link :only="['users']">Refresh Users</Link>
router.visit('/users', { only: ['users'] })

Framework Support

  • Client: Vue 3 (@inertiajs/vue3), React (@inertiajs/react), Svelte (@inertiajs/svelte)
  • Server: Laravel (official), Rails, Phoenix, Symfony (community adapters)

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

daisyui

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

convert-url-html-to-md

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

laravel-livewire

No summary provided by upstream source.

Repository SourceNeeds Review