Skip to content
Promise toast, light
Light
Promise toast, dark
Dark

Every state

  • Promise toast, default, light
    Promise toast, default, dark

    default

  • Promise toast, loading, light
    Promise toast, loading, dark

    loading

  • Promise toast, success, light
    Promise toast, success, dark

    success

  • Promise toast, error, light
    Promise toast, error, dark

    error

  • Promise toast, retrying, light
    Promise toast, retrying, dark

    retrying

  • Promise toast, focus, light
    Promise toast, focus, dark

    focus

Props

PropTypeDefaultWhat it does
idstring"toast-promise"unique on the page; the title and message ids hang off it.
promise() => Promise<unknown>simulatePublishthe work; the toast follows it from loading to success or error, and Try again calls it again.
loadingstring"Publishing article"the title while it runs, e.g. "Publishing article".
loadingMessagestring"Uploading 14 images and checking the links."Loading message.
successstring | ((data: unknown) => string)"Article published"the title once it resolves; a function gets the resolved value.
successMessagestring"It is live on your site and in the RSS feed."Success message.
errorstring | ((error: unknown) => string)"Couldn’t publish"the title once it rejects; a function gets the error.
errorMessagestring"Two images are still uploading. Your draft is safe."Error message.
viewHrefstring"#article"View href.
viewLabelstring"View article"View label.
retryLabelstring"Try again"Retry label.
onSuccess(data: unknown) => void–On success.
onError(error: unknown) => void–On error.
openboolean–controlled open state; leave it out to let the toast manage itself.
defaultOpenbooleantrueDefault open.
onOpenChange(open: boolean) => void–On open change.
inlinebooleanfalsedraws the toast in place instead of in the fixed bottom-right viewport.
classNamestring–Class name.

More toasts

All 7
toast-03 is in UI ProGet UI Pro, €199

Preview

Open the page
In UI Pro: get it, €199 once

With every block and theme. 400+ buyers since 2020. Plans