Skip to content

Toast

Displays short, temporary messages to provide feedback or notifications to users.

First release: 1.0.0 Latest update: July 1, 2025 Current version: 1.0.0

React Angular Vue Svelte HTML

Import

import { PlusToast } from '@plusui/react';
import { PlusToastComponent } from '@plusui/angular';
import { PlusToast } from '@plusui/vue';
import PlusToast from '@plusui/svelte';
<script src="https://cdn.jsdelivr.net/npm/@plusui/core"></script>

Package

@plusui/react
@plusui/angular
@plusui/vue
@plusui/svelte
@plusui/core

Docs

Changelog

Toast Changelog

Recent changes and updates for the toast component

v1.0.0

June 20, 2025
Feat

Added Toast component for notifications

  • Multiple status variants
  • Auto-dismiss functionality
  • Custom duration settings
  • Position management
  • Accessibility support

The Toast component displays brief, temporary messages that provide feedback or notifications to users. It supports different status types, customizable content, and automatic or manual dismissal.

A simple toast with a message.

This is a basic toast message
Show code

Use the status prop to indicate the type of message with appropriate colors and icons.

Status messageStatus messageStatus messageStatus messageStatus message
Show code

Control the toast’s dimensions using the size prop.

Toast messageToast messageToast message
Show code

The kind prop controls the visual appearance of the toast.

Toast with different stylesToast with different stylesToast with different styles
Show code

Use the header prop or slot to add a title to your toast.

Your changes have been saved successfully.
Show code

Override the default status icon using the icon prop or the icon slot.

Message with custom icon
Show code

Control whether the toast can be dismissed using the dismiss prop.

This toast can be dismissedThis toast can be dismissed
Show code

Hide the default status icon by setting status-icon to false.

Toast without status icon
Show code

Listen for the plus-close event to handle toast dismissal.

Notification
Click the X button to dismiss this toast.

Show code
Show console
  • Screen Reader:
    • Uses role="status" to announce content changes to screen readers.
    • aria-live is set to "assertive" for danger/warning toasts and "polite" for others.
    • aria-atomic="true" ensures the entire toast content is announced when it appears.
    • The close button has aria-label="Close" for screen reader users.
  • Required Developer Actions:
    • Provide meaningful content in the message and header slots.
    • Consider the urgency of the message when choosing status types.
    • Ensure sufficient color contrast for custom styling.
NameTypeDefaultDescriptionRequired
size'sm' | 'md' | 'lg''md'Size of the toast.No
kind'default' | 'outlined' | 'dashed''default'Visual style of the toast.No
status'info' | 'success' | 'warning' | 'danger' | 'default''default'Status variant controlling color and default icon.No
dismissbooleantrueWhether to show the dismiss button.No
statusIconbooleantrueWhether to show the default status icon.No
headerstringundefinedHeader text content (can also be provided via slot).No
iconstringundefinedCustom icon name to override the default status icon.No
messagestringundefinedMessage text content (can also be provided via slot).No
NamePayload TypeDescription
plus-closeCustomEvent<void>Fired when the toast is dismissed.
NameDescription
default (unnamed)The main message content of the toast.
headerOptional header content for the toast.
iconCustom icon content to replace the status icon.
PartDescription
baseThe main container element.
containerThe main container for content.
iconThe status icon container.
contentThe container for header and message.
headerThe header text element.
messageThe message text element.
close-buttonThe close button container.
NameDescription
--toast-border-radiusControls the border radius.
--toast-paddingControls the padding.
--icon-sizeControls the status icon size.
--close-button-sizeControls the close button size.

Join the Community

Plus UI is built by the community. Join us on our platforms to contribute, get help, and stay up to date.