Confirm, then run a flow
A compact example: confirm in a popup, run an async action, and show its result.
Confirm, then run
One button opens a confirmation popup; accepting it starts the flow.
Flow: idle
const flow = useSubmitFlow({
publish: {
run: publishNotes,
confirm: { title: 'Publish these notes?' },
pendingLabel: 'Publishing…',
success: 'Notes published.',
},
})
<SubmitFlowRoot flow={flow}>
<ActionButton action="publish">Publish notes</ActionButton>
<SubmitFeedback />
</SubmitFlowRoot>This demo uses a local, temporary action. It does not send data or write to a service.