Submit Without Reload
Clientside Interactivityframework/ui ↗
Submit a form and see the result inline — the page never reloads.
Live
A comment form, a search box, a quick-add field — submit without losing scroll position or context. The server processes it and returns a snippet (confirmation text, rendered item, status message) that appears right below the form.
Put data-fui-rpc on a <form> element. The runtime intercepts the submit, POSTs fields as JSON, and writes the response into the signal. Add data-fui-rpc-reset to clear the form after success so the user can submit again.
interactive.OnSubmit(
render.Tag("form", nil,
render.Tag("input", map[string]string{"name": "body", "required": ""}),
render.Tag("button", map[string]string{"type": "submit"}, render.Text("Post")),
),
interactive.Post("/api/comment").
OnSuccess(
interactive.SetSignal("comment-result"),
interactive.ResetForm(),
),
)Live
Type a message and press Send. The response appears below; the form clears.