toast
caution
All props/parameters are optional unless they are marked with an asterisk ( * ).
Example
import { common } from "replugged";
const { toast } = common;
toast.toast("Toast text", toast.Kind.FAILURE, { duration: 5000 });
Enums
Enum | Description |
---|---|
toast.Kind | Toast types MESSAGE | SUCCESS | FAILURE | CUSTOM | CLIP |
toast.Position | Toast positions TOP | BOTTOM |
Functions
Name | Parameters | Return Type | Description |
---|---|---|---|
toast | * content : string | ReactElement | null kind : toast.Kind opts : ToastOptions | void | Makes a toast appear on the screen; toast.Kind.SUCCESS is the default type |
Types
ToastOptions
Name | Type | Default | Description |
---|---|---|---|
component | ReactElement | Custom toast component | |
duration | number | 3000 | How long the toast stays on the screen in milliseconds |
position | toast.Position | toast.Position.TOP | Toast position |