Skip to content

[3.x] Add Layers documentation - #82

Open
claudiodekker wants to merge 1 commit into
inertiajs:mainfrom
claudiodekker:layers
Open

[3.x] Add Layers documentation#82
claudiodekker wants to merge 1 commit into
inertiajs:mainfrom
claudiodekker:layers

Conversation

@claudiodekker

@claudiodekker claudiodekker commented Aug 27, 2026

Copy link
Copy Markdown

This documents the new Layers feature (inertiajs/inertia#3236): pages that render on top of the page they were opened from, which is how you build modals, slideovers, and wizards in Inertia.

Rather than adding a standalone "Layers" section, each piece is documented on the page where you'd naturally look for it:

  • Responses: returning a layer with ->layer(base: ..., key: ...), and closing one with Inertia::close().
  • Redirects: marking a redirect as a detour with ->interstitial(), so a pending layer survives a full-page interruption like password confirmation.
  • Manual visits: the client side. router.layer(), local layers, useLayer(), making requests inside a layer, and layer events.
  • Client-side setup: the layer option (your app-wide shell component) and the loading option (the placeholder shown while a directly-opened layer's base page is fetched).
  • The protocol: the layer, close, and interstitial page-object fields, close instructions, and detours, for anyone implementing a backend adapter.
  • Testing: hasLayer(), layerBase(), and isClose() assertions.

All client-side examples come in Vue, React, and Svelte flavors, and the sections cross-link so you can start from whichever end you're coming from.

Companion PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant