dj-form-pending — auto-bound submit state

React 19 useFormStatus() parity. Any descendant of a submitting <form> reacts to its in-flight state. No props, no useState.

Newsletter signup

dj-form-pending

Why it matters

  • Zero prop drilling. The submit button doesn't know about the form's state — it asks the form via attribute.
  • Multiple actions per page. Each form has its own pending state. Buttons disable themselves only when their own form is submitting.
  • Auto re-enable. When the action resolves (success or error), every dj-form-pending attribute auto-reverts.
{# any descendant of the submitting form auto-reacts via dj-form-pending #}
<form dj-submit="signup">
    <input name="email" required>
    <button type="submit" dj-form-pending="disabled">
        <span dj-form-pending="hide">Sign up</span>
        <span dj-form-pending="show">Sending…</span>
    </button>
</form>