Redirect After Action
Click a button → server confirms → you land on a new page, no full reload.
Live
Static preview
This is a read-only export. Run the app locally for full interactivity — live search, demos, and server-driven islands need the Go server.
Click a button → server confirms → you land on a new page, no full reload.
A user creates a resource ("New project") and on success should land on that resource's page. Or completes a wizard step and moves to the next. The server confirms the action, then the client transitions to the destination.
Add data-fui-rpc-navigate="/path" alongside data-fui-rpc. On 2xx the runtime calls history.pushState and fires the SPA router, swapping <main> content just like a link click — but only after the server confirms the action succeeded.
interactive.OnClick(
render.Tag("button", nil, render.Text("Create Project")),
interactive.Post("/api/projects").
OnSuccess(interactive.Navigate("/projects/new-id")),
)Click — the page transitions to the Button component via SPA. Use the back button to return.