← All examplesFlows

Three actions: draft, publish, or cancel

Review a release, save a private draft, or publish it. Simulate an error and retry inside the dialog.

Release review

Save privately, publish now, or cancel. Try a publish failure to see the dialog stay open with both actions available for a new attempt.

The release is still a draft.

Three actions · one flow

Ready to share this release?

Save a private draft or publish the release notes for everyone to see.

Release 2.4

Keyboard improvements, new themes, and clearer cancellation feedback.

Audience · Everyone
CodeFocused snippet
const flow = useSubmitFlow({
  save: {
    run: saveDraft,
    pendingLabel: 'Saving draft…',
    feedback: 'inline',
    onSuccess: closeDialog,
  },
  publish: {
    run: publishRelease,
    pendingLabel: 'Publishing…',
    feedback: 'inline',
    error: 'Publishing failed. Try again or save a draft.',
    onSuccess: closeDialog,
  },
})

// Dialog footer: CancelButton + save ActionButton + publish ActionButton.

Read the related guide →

This demo uses a local, temporary action. It does not send data or write to a service.