---
title: React Toast Component
name: Toast
description: Push notifications to your visitors with a toast, a lightweight and easily customizable alert message.
route: /components/toast/
other_frameworks: toast
---

React toasts are lightweight notifications designed to mimic the push notifications that have been popularized by mobile and desktop operating systems. They’re built with flexbox, so they’re easy to align and position.

## Overview

Things to know when using the toast plugin:

- Toasts are opt-in for performance reasons, so **you must initialize them yourself**.
- Toasts will automatically hide if you do not specify `autohide: false`.

## Examples

### Basic

To encourage extensible and predictable toasts, we recommend a header and body. Toast headers use `display: flex`, allowing easy alignment of content thanks to our margin and flexbox utilities.

Toasts are as flexible as you need and have very little required markup. At a minimum, we require a single element to contain your "toasted" content and strongly encourage a dismiss button.

<ExampleSnippet component="ToastExample" componentName="React Toast" />

<ExampleSnippet component="ToastLiveExample" componentName="React Toast" />

### Translucent

Toasts are slightly translucent to blend in with what's below them.

<ExampleSnippet className="bg-dark" component="ToastTranslucentExample" componentName="React Toast" />

### Stacking

You can stack toasts by wrapping them in a toast container, which will vertically add some spacing.

<ExampleSnippet component="ToastStackingExample" componentName="React Toast" />

### Custom content

Customize your toasts by removing sub-components, tweaking them with [utilities](https://coreui.io/bootstrap/docs/utilities/api), or by adding your own markup. Here we've created a simpler toast by removing the default `<CToastHeader>`, adding a custom hide icon from [CoreUI Icons](https://coreui.io/icons/), and using some [flexbox utilities](https://coreui.io/bootstrap/docs/utilities/flex) to adjust the layout.

<ExampleSnippet component="ToastCustomContentExample" componentName="React Toast" />

Alternatively, you can also add additional controls and components to toasts.

<ExampleSnippet component="ToastCustomContent2Example" componentName="React Toast" />

### Color schemes

Building on the above example, you can create different toast color schemes with our [color](https://coreui.io/bootstrap/docs/utilities/colors) and [background](https://coreui.io/bootstrap/docs//utilities/background) utilities. Here we've set `color="primary"` and added `.text-white` class to the `<Ctoast>`, and then set `white` property to our close button. For a crisp edge, we remove the default border with `.border-0`.

<ExampleSnippet component="ToastColorSchemesExample" componentName="React Toast" />

## API

Check out the documentation below for a comprehensive guide to all the props you can use with the components mentioned here.

- [&lt;CToast /&gt;](./api/#ctoast)
- [&lt;CToastHeader /&gt;](./api/#ctoastheader)
- [&lt;CToastBody /&gt;](./api/#ctoastbody)
- [&lt;CToastClose /&gt;](./api/#ctoastclose)
- [&lt;CToaster /&gt;](./api/#ctoaster)
