Skip to main content
These recipes assume Hypermedia and Server are set up. For action options and swap modes, see the getting started hypermedia page.

Inline panel on demand

Load detail into a sidebar without a full navigation:
Handler returns a small HTML fragment (not JSON). The client swaps it into #detail.

Append to a list

Use beforeend to add server-rendered rows:

Form that updates a region

Prevent double submission with on:submit.prevent:
The handler can return a success or error fragment for #status.

Application errors vs infrastructure errors

The server owns application outcomes. The client owns transport and infrastructure failures. Return a small HTML fragment for expected failures (for example 422 with field errors). Do not rely on Nitro’s full error page inside a fragment target — Aero refuses to inject full documents (<!DOCTYPE / <html>) or overlay-bootstrap shells. Listen for transport and infrastructure failures:

Save with loading feedback

Use busy or state so the trigger reflects in-flight requests (requires reactivity + hypermedia):
Phase classes aero-loading, aero-swapping, and aero-settling apply to involved elements during the lifecycle. Static navigation still works when JS is off:
The compiler emits href="/api/docs" for a static GET on an anchor. With JS, hypermedia intercepts the click and swaps into main.

Lifecycle hooks

Listen for swap completion (analytics, focus management):

Server-driven URL

Return an aero-push-url response header to update the address bar without a client pushUrl option.

When to use HTMX instead

See Hypermedia for enabling Aero hypermedia alongside HTMX.