Vicinae

Toast

Brief feedback notifications at the bottom of the Vicinae window.

showToast

import { showToast, Toast } from "@vicinae/api";

await showToast({ title: "Fruit added", style: Toast.Style.Success });

Styles

StyleDescription
Toast.Style.SuccessSomething succeeded
Toast.Style.FailureSomething failed
Toast.Style.AnimatedSpinning indicator for ongoing operations

Animated Toast

Show a loading toast and update it when the operation completes.

import { showToast, Toast } from "@vicinae/api";

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

// ... do work ...

// assigning these properties immediately updates the toast
toast.style = Toast.Style.Success;
toast.title = "Upload complete";

Error Handling

import { showToast, Toast } from "@vicinae/api";

try {
  await fetchFruits();
  await showToast({ title: "Loaded fruits" });
} catch (error) {
  await showToast({ title: "Failed to load", message: String(error), style: Toast.Style.Failure });
}