Components
Import UI components from react-submit-flow. They are client components and can be placed inside an existing client form or action group.
SubmitFlowRoot
Provides a flow to descendant buttons and SubmitFeedback without adding a wrapper element.
<SubmitFlowRoot flow={flow}>
<ActionButton action="archive" input={{ id }}>
Archive
</ActionButton>
<SubmitFeedback />
</SubmitFlowRoot>
SubmitFlowForm
Renders one native <form>. Set defaultAction for Enter-key submissions and optionally map each action's FormData to its typed input with getInput.
<SubmitFlowForm
flow={flow}
defaultAction="save"
getInput={{ save: (data) => ({ title: String(data.get("title") ?? "") }) }}
>
<input name="title" required />
<SubmitButton action="save">Save</SubmitButton>
</SubmitFlowForm>
Buttons and inline feedback
SubmitButtonsubmits the nearestSubmitFlowForm; itsactionselects the action.ActionButtoninvokes the flow directly and acceptsactionplus optionalinput.CancelButtonrequests cancellation while busy; while idle it calls itsonCancelcallback.BackButtoncalls its requiredonBackcallback and disables while the flow is busy.SubmitFeedbackdisplays the current flow's pending or feedback message, or renders custom children.
Buttons accept native button attributes and forward refs. The library controls type, action selection, and effective busy state. See form behavior for event and validation details.