1. framework components
  2. toast

Toast

Display brief messages to users.

Usage

This component acts as a Singleton - meaning you only implement a single instance (typically at the root scope of your app) and then reuse it over and over. To do this, implement the <Toast.Group> at the root scope of your app (the root layout), and use a shared createToaster() instance to trigger messages to that group from anywhere in your application.

Type

Placement

Action

Closable

Meta

Promise

API Reference

Root

Property Default Type
toast -
Omit<Options<any>, "id" | "parent">
element -
((attributes: HTMLAttributes<"div">) => Element) | undefined
Render the element yourself

RootContext

Property Default Type
children -
(toast: ToastApi<PropTypes, any>) => ReactNode

Group

Property Default Type
toaster -
ToastStore<any>
children -
((toast: ToastProps<any>) => Element | null) | undefined
element -
((attributes: HTMLAttributes<"div">) => Element) | undefined
Render the element yourself

Message

Property Default Type
element -
((attributes: HTMLAttributes<"div">) => Element) | undefined
Render the element yourself

Title

Property Default Type
element -
((attributes: HTMLAttributes<"div">) => Element) | undefined
Render the element yourself

Description

Property Default Type
element -
((attributes: HTMLAttributes<"div">) => Element) | undefined
Render the element yourself

ActionTrigger

Property Default Type
element -
((attributes: HTMLAttributes<"button">) => Element) | undefined
Render the element yourself

CloseTrigger

Property Default Type
element -
((attributes: HTMLAttributes<"button">) => Element) | undefined
Render the element yourself