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.
@action
dj-form-pending
@server_function
dj-transition
ActivityMixin
WizardMixin
dj_suspense
defer()
DataTableMixin
dj-virtual
dj-viewport
UploadMixin
Newsletter signup
dj-form-pendingWhy 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-pendingattribute 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>