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

txt
card p-3 w-full md:w-md ring flex items-center gap-2 preset-filled-surface-50-950 ring-surface-200-800 data-[type=success]:preset-filled-success-500 data-[type=warning]:preset-filled-warning-500 data-[type=error]:preset-filled-error-500
PropDefaultType
toastOptions<any>

elementSnippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

Context

PropDefaultType
childrenSnippet<[() => ToastApi<PropTypes, any>]>

Group

PropDefaultType
toasterToastStore<any>

childrenSnippet<[ToastProps<any>]> | undefined

elementSnippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

Message

txt
flex-1
PropDefaultType
elementSnippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

Title

txt
font-medium text-sm
PropDefaultType
elementSnippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

Description

txt
text-sm
PropDefaultType
elementSnippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

ActionTrigger

txt
btn preset-filled
PropDefaultType
elementSnippet<[HTMLAttributes<"button">]> | undefined

Render the element yourself

CloseTrigger

txt
btn-icon hover:preset-tonal
PropDefaultType
elementSnippet<[HTMLAttributes<"button">]> | undefined

Render the element yourself

View page on GitHub