Marigold
Getting StartedFoundationsComponentsPatternsRecipesReleases
Discover new Tutorials!

Components

Overview

Application

MarigoldProvider
updated
RouterProvider
updated

Layout

Aside
Aspect
Breakout
Center
Columns
Container
Grid
Inline
Inset
Scrollable
Split
Stack
updated
Tiles

Form

Autocomplete
Button
updated
Calendar
Checkbox
ComboBox
DateField
DatePicker
Form
Multiselect
new
NumberField
Radio
SearchField
Select
Slider
Switch
TextArea
TextField
TimeField
new

Collection

SelectList
updated
Table
updated
Tag

Navigation

Accordion
Breadcrumbs
beta
Pagination
Tabs

Overlay

ContextualHelp
new
Dialog
Menu
Toast
beta
Tooltip
updated

Content

Badge
Body
Card
Divider
updated
Footer
Header
Headline
updated
Icon
updated
Image
Link
updated
List
updated
SectionMessage
SVG
updated
Text
updated
VisuallyHidden
updated
XLoader

Formatters

DateFormat
NumericFormat

Hooks and Utils

cn
cva
extendTheme
useAsyncListData
useListData
useResponsiveValue
useTheme

Toast

Toasts are used to display brief messages or notifications that appear temporarily on the screen.

A Toast is a small, temporary notification that appears on the screen to inform users about the outcome of an action or to provide brief feedback. Toasts are commonly used in applications to deliver messages such as success notifications, error alerts, or informational updates without interrupting the user's workflow.

Anatomy

Anatomy of toast

Appearance

The appearance of a component can be customized using the variant and size props. These props adjust the visual style and dimensions of the component, available values are based on the active theme.

Variant
Size
The selected theme does not has any options for "size".
Notification
Here is a general notification about your booking.
PropertyTypeDescription
variantdefault | success | warning | info | errorThe available variants of this component.
size-The available sizes of this component.

Usage

The <ToastProvider> Component should be in the root of your application, so it can be used anywhere in your app. You can use the addToast function to add a Toast to the Toaster. The Toast will appear at the bottom right of the screen by default. with the position prop you can change the position of all Toasts.

Simple Toast

A Toast should be used when you want to give users quick, non-intrusive feedback after an action, such as saving, deleting, or uploading data. It appears on the edge of the screen and should remain visible for at least 5 seconds or until the user manually dismisses it. Because it doesn’t interrupt the user’s workflow, a Toast is ideal for success messages, notifications, or error alerts that don’t need immediate interaction. The message should be clear, concise, and easy to read.

Preview
Code

Auto dismiss

This Toast will automatically dismiss itself after a specified duration. This is useful for notifications that do not require user interaction and should disappear after a short time. The time is in milliseconds.

Preview
Code

Programmatic dismiss

addToast does return the key of the Toast, with this the Toast can be dismissed programmatically, by saving the key of the Toast and then using removeToast.

Preview
Code

Close all Toasts

All Toasts can be dismissed with clearToasts.

Preview
Code

Props

Did you know? You can explore, test, and customize props live in Marigold's storybook. Watch the effects they have in real-time!
View Toast stories

Toast

toast
{
  content: ToastContentProps;
  key: string;
}
Last update: 9 minutes ago
Build with 🥵, 🧡 and
v14.1.1