toast
The imperative API for showing, updating, and dismissing toasts.
import { toast, fontIcon } from 'react-native-super-toast';Functions
| Signature | Description |
|---|---|
toast(title: string, options?: ToastOptions): ToastId | Shows a toast without an icon. |
toast.success(title, options?) | Success variant. |
toast.error(title, options?) | Error variant. |
toast.warning(title, options?) | Warning variant. |
toast.info(title, options?) | Info variant. |
toast.loading(title, options?) | Loading variant. Stays until updated or dismissed. |
toast.promise<T>(value: Promise<T> | (() => Promise<T>), options: PromiseOptions<T>): ToastId | Loading toast that updates when the promise settles. |
toast.dismiss(id?: ToastId): ToastId | undefined | Dismisses one toast, or all toasts when id is omitted. |
toast.wiggle(id: ToastId): void | Wiggles a visible toast. |
fontIcon(options: Omit<ToastFontIcon, 'type'>): ToastFontIcon | Creates a font glyph icon. |
ToastOptions
Prop
Type
PromiseOptions
PromiseOptions<T> extends ToastOptions.
Prop
Type