Toast

Transient messages with tone and screen position.

Installation

Add this item from the registry, or import it from the package after installing Default File UI.

Registry path

itsvigneshv/default-file-ui/toast

Package import

import { toast, Toaster, setToastPosition } from "@default-file/ui/components/df-toast"

Tones

Trigger toasts for each tone. The app root already mounts Toaster.

Position

Place toasts in any corner, along an edge centre, or dead centre. Use the direction pad to try each spot.

Active: Bottom right

Properties

Transient messages. Call toast helpers from code and mount Toaster once in the app shell.

toast

Imperative helpers.

PropTypeDefaultNotes
toast.success(message: string) => stringShow a success toast; returns an id.
toast.error(message: string) => stringShow an error toast.
toast.info(message: string) => stringShow an info toast.
toast.warning(message: string) => stringShow a warning toast.
toast.dismiss(id?: string) => voidDismiss one toast by id, or all when omitted.

Toaster

PropTypeDefaultNotes
position"top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | "top" | "bottom" | …"bottom-right"Screen corner or edge for the stack.
classNamestringAdditional styles on the toaster root.

setToastPosition

PropTypeDefaultNotes
setToastPosition(position: ToastPosition) => voidGlobally update where new toasts appear.