Redirect After Action

Clientside Interactivityframework/ui ↗

Click a button → server confirms → you land on a new page, no full reload.

Live

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")),
)
Live

Click — the page transitions to the Button component via SPA. Use the back button to return.