The options to create a Toast.
import { showToast, Toast } from "@raycast/api";export default async () => { const options: Toast.Options = { style: Toast.Style.Success, title: "Finished cooking", message: "Delicious pasta for lunch", primaryAction: { title: 'Do something', onAction: () => { console.log("The toast action has been triggered") } } }; await showToast(options);}; Copy
import { showToast, Toast } from "@raycast/api";export default async () => { const options: Toast.Options = { style: Toast.Style.Success, title: "Finished cooking", message: "Delicious pasta for lunch", primaryAction: { title: 'Do something', onAction: () => { console.log("The toast action has been triggered") } } }; await showToast(options);};
Optional
An additional message for the Toast. Useful to show more information, e.g. an identifier of a newly created asset.
The style of a Toast.
The title of a Toast. Displayed on the top.
The options to create a Toast.
Example