Optimistic Inline Edit

Optimistic UIframework/ui ↗

Edit a field + save; the button flips optimistically, rolls back + shakes on rejection.

Live

ui.OptimisticAction(ui.OptimisticActionConfig{
    Endpoint:     "/api/rename/validate",
    IdleLabel:    "Save",
    SuccessLabel: "Saved ✓",
})
Click Save — the button flips to “Saved ✓” optimistically, the 2xx keeps it committed. Click Save (reject) — the button flips, then shakes and reverts when the 4xx lands. To transmit the actual input value, wrap the field in a form with interactive.OnSubmit (see the optimistic-ui doc, Recipe 2).