@vicinae/api
    Preparing search index...

    Class Toast

    A Toast with a certain style, title, and message.

    import { showToast, Toast } from "@raycast/api";
    import { setTimeout } from "timers/promises";

    export default async () => {
    const toast = await showToast({ style: Toast.Style.Animated, title: "Uploading image" });

    await setTimeout(1000);

    toast.style = Toast.Style.Success;
    toast.title = "Uploaded image";
    };
    Index

    Constructors

    Accessors

    • get message(): undefined | string

      An additional message for the Toast. Useful to show more information, e.g. an identifier of a newly created asset.

      Returns undefined | string

    • set message(message: undefined | string): void

      Parameters

      • message: undefined | string

      Returns void

    • get title(): string

      The title of a Toast. Displayed on the top.

      Returns string

    • set title(title: string): void

      Parameters

      • title: string

      Returns void

    Methods

    • Hides the Toast.

      Returns Promise<void>

      A Promise that resolves when toast is hidden.

    • Shows the Toast.

      Returns Promise<void>

      A Promise that resolves when the toast is shown.

    • Returns Promise<void>