Font Awesome Build Awesome
Try SSR Server-side rendering (SSR) generates component HTML on the server before the page loads, improving SEO and initial load time. Use the switch to see Web Awesome components render with and without SSR.
Search this website ⌘KCtrl+K Light Dark System Docs Select Color Scheme Default Awesome Shoelace Active Brutalist Glossy Matter Mellow Playful Premium Tailspin Docs Select Theme View Project on GitHub Star Project on GitHub
Start Components Docs Help
Login Log into your account
Web Awesome Font Awesome Build Awesome
Search this site… /
Try SSR Server-side rendering (SSR) generates component HTML on the server before the page loads, improving SEO and initial load time. Use the switch to see Web Awesome components render with and without SSR.
Light Dark System Docs Select Color Scheme Default Awesome Shoelace Active Brutalist Glossy Matter Mellow Playful Premium Tailspin Docs Select Theme

Getting Started

  • Installation
  • Usage
  • Forms
  • Localization
  • Frameworks
  • Using with AI
  • Figma Design Kit ProThis requires access to Web Awesome Pro
  • Server Rendering

Resources

  • Accessibility
  • Browser Support
  • Contributing
  • Patterns ProPatterns require access to Web Awesome Pro
  • Migrating from Shoelace
  • Visual Tests
  • Changelog
  • Help & Support

Theming & Utilities

  • Overview
  • Built-in Themes
  • Color Palettes
  • Design Tokens
  • Customizing & Theming
  • CSS Utilities

Actions

  • Button
  • Button Group
  • Copy Button
  • Dropdown
    • Dropdown Item

Forms

  • Checkbox
  • Checkbox Group
  • Color Picker
  • Combobox ProThis requires access to Web Awesome Pro
  • Date Input ProThis requires access to Web Awesome Pro
  • Date Picker ProThis requires access to Web Awesome Pro
  • File Input ProThis requires access to Web Awesome Pro
  • Input
  • Known Date
  • Number Input
  • Radio Group
    • Radio
  • Rating
  • Select
    • Option
  • Slider
  • Switch
  • Textarea
  • Time Input
  • Data Grid Planned A Web Awesome Kickstarter stretch goal!

Layout

  • Accordion
    • Accordion Item
  • Card
  • Details
  • Dialog
  • Divider
  • Drawer
  • Page
  • Scroller
  • Split Panel

Navigation

  • Breadcrumb
    • Breadcrumb Item
  • Tab Group
    • Tab
    • Tab Panel
  • Tree
    • Tree Item

Feedback

  • Badge
  • Callout
  • Progress Bar
  • Progress Ring
  • Skeleton
  • Spinner
  • Tag
  • Toast ProThis requires access to Web Awesome Pro
  • Toast Item ProThis requires access to Web Awesome Pro
  • Tooltip

Media

  • Animated Image
  • Avatar
  • Carousel
    • Carousel Item
  • Comparison
  • Icon
  • Markdown
  • QR Code
  • Video ProThis requires access to Web Awesome Pro
  • Video Playlist ProThis requires access to Web Awesome Pro
  • Zoomable Frame

Data Viz ProThis requires access to Web Awesome Pro

  • Bar Chart
  • Bubble Chart
  • Doughnut Chart
  • Line Chart
  • Pie Chart
  • Polar Area Chart
  • Radar Chart
  • Scatter Chart
  • Sparkline
  • Advanced Usage

Helpers

  • Animation
  • Format Bytes
  • Format Date
  • Format Number
  • Include
  • Intersection Observer
  • Mutation Observer
  • Popover
  • Popup
  • Random Content
  • Relative Time
  • Resize Observer

Toast Item

  • Examples
  • Variant
  • Size
  • Icons
  • Providing Content
  • Duration
  • Hover & Focus Behavior
  • The Close Button
  • Customizing the Accent
  • Customizing the Padding
  • API
  • Importing
  • Slots
  • Attributes & Properties
  • Methods
  • Events
  • CSS Custom Properties
  • CSS Parts
  • Dependencies
On This Page...
  • Examples
  • Variant
  • Size
  • Icons
  • Providing Content
  • Duration
  • Hover & Focus Behavior
  • The Close Button
  • Customizing the Accent
  • Customizing the Padding
  • API
  • Importing
  • Slots
  • Attributes & Properties
  • Methods
  • Events
  • CSS Custom Properties
  • CSS Parts
  • Dependencies

Toast Item

<wa-toast-item>
ProIncluded with Web Awesome Pro Stable Feedback Since 3.3

Toast items are individual notifications displayed within a toast container.

Get Toast Item with Web Awesome Pro! Subscribing to Web Awesome Pro gives you every Pro component, plus premium themes, color tools, team collaboration, and more.
  • Pro Components
  • Responsive Layout Tools
  • Ever-Growing Pattern Library
  • Unlimited Hosted Projects
  • Pre-Built Pro Themes
  • Pro Theme Builder
  • Pro Color Tools
  • Official Figma Design Kit Newer additions to Web Awesome, like <wa-toast>, aren't included in the currently available kit, but a new version is in the works.
    Track its progress on GitHub.
  • WA Pro Perpetual License
  • Actual Human™ Support
Get Web Awesome Pro + Toast Item!

Already have Pro? Log in

This is how a toast item looks!
<wa-toast-item variant="brand" duration="0">
  <wa-icon slot="icon" name="bell"></wa-icon>
  This is how a toast item looks!
</wa-toast-item>

Toast items are meant to live inside a <wa-toast> container.
The container manages their lifecycle and positioning. For usage examples showing how to display notifications, see the Toast documentation.

Examples

Link to This Section

Variant

Link to This Section

Use the variant attribute to change the toast item's visual style. The variant determines the accent color on the left side and the icon color. Available variants are neutral (default), brand, success, warning, and danger.

Neutral variant (default) Brand variant Success variant Warning variant Danger variant
<div class="wa-stack">
  <wa-toast-item variant="neutral" duration="0">
    <wa-icon slot="icon" name="gear"></wa-icon>
    Neutral variant (default)
  </wa-toast-item>

  <wa-toast-item variant="brand" duration="0">
    <wa-icon slot="icon" name="circle-info"></wa-icon>
    Brand variant
  </wa-toast-item>

  <wa-toast-item variant="success" duration="0">
    <wa-icon slot="icon" name="check"></wa-icon>
    Success variant
  </wa-toast-item>

  <wa-toast-item variant="warning" duration="0">
    <wa-icon slot="icon" name="circle-exclamation"></wa-icon>
    Warning variant
  </wa-toast-item>

  <wa-toast-item variant="danger" duration="0">
    <wa-icon slot="icon" name="triangle-exclamation"></wa-icon>
    Danger variant
  </wa-toast-item>
</div>

Size

Link to This Section

Use the size attribute to change the toast item's size.

Extra Small Small Medium (default) Large Extra Large
<div class="wa-stack">
  <wa-toast-item size="xs" duration="0">
    <wa-icon slot="icon" name="shrimp"></wa-icon>
    Extra Small
  </wa-toast-item>

  <wa-toast-item size="s" duration="0">
    <wa-icon slot="icon" name="mouse-field"></wa-icon>
    Small
  </wa-toast-item>

  <wa-toast-item size="m" duration="0">
    <wa-icon slot="icon" name="horse"></wa-icon>
    Medium (default)
  </wa-toast-item>

  <wa-toast-item size="l" duration="0">
    <wa-icon slot="icon" name="elephant"></wa-icon>
    Large
  </wa-toast-item>

  <wa-toast-item size="xl" duration="0">
    <wa-icon slot="icon" name="whale"></wa-icon>
    Extra Large
  </wa-toast-item>
</div>

Icons

Link to This Section

Use the icon slot to display an icon at the start of the toast item. The icon color automatically matches the variant's accent color.

Your changes have been saved! You have 3 new messages Your session will expire soon
<div class="wa-stack">
  <wa-toast-item variant="success" duration="0">
    <wa-icon slot="icon" name="check"></wa-icon>
    Your changes have been saved!
  </wa-toast-item>

  <wa-toast-item variant="brand" duration="0">
    <wa-icon slot="icon" name="envelope"></wa-icon>
    You have 3 new messages
  </wa-toast-item>

  <wa-toast-item variant="warning" duration="0">
    <wa-icon slot="icon" name="clock"></wa-icon>
    Your session will expire soon
  </wa-toast-item>
</div>

Toast items work fine without icons too.

A simple notification without an icon.
<wa-toast-item variant="neutral" duration="0"> A simple notification without an icon. </wa-toast-item>

Providing Content

Link to This Section

The default slot accepts any HTML content, allowing you to create rich notifications with formatted text, links, and interactive elements.

New message from Alex
Hey, are you available for a quick call?
Upload complete
View file · Share
You've earned a reward!
Claim Now Later
<div class="wa-stack">
  <wa-toast-item variant="brand" duration="0">
    <wa-icon slot="icon" name="bell"></wa-icon>
    <strong>New message from Alex</strong><br />
    Hey, are you available for a quick call?
  </wa-toast-item>

  <wa-toast-item variant="success" duration="0">
    <wa-icon slot="icon" name="cloud-arrow-up"></wa-icon>
    <strong>Upload complete</strong><br />
    <a href="#">View file</a> · <a href="#">Share</a>
  </wa-toast-item>

  <wa-toast-item variant="brand" duration="0">
    <wa-icon slot="icon" name="gift"></wa-icon>
    You've earned a reward!
    <div style="margin-block-start: var(--wa-space-xs);">
      <wa-button variant="brand" size="s">Claim Now</wa-button>
      <wa-button appearance="filled" size="s">Later</wa-button>
    </div>
  </wa-toast-item>
</div>

Duration

Link to This Section

The duration attribute controls how long the toast item displays before automatically dismissing (in milliseconds). The default is 5000 (5 seconds). Set to 0 to disable auto-dismissal.

When a duration is set, a progress ring appears around the close button showing the remaining time.

<wa-toast-item variant="brand" duration="5000">...</wa-toast-item>
<wa-toast-item variant="brand" duration="10000">...</wa-toast-item>
<wa-toast-item variant="brand" duration="0">...</wa-toast-item>

Hover & Focus Behavior

Link to This Section

Toast items automatically pause their countdown timer when the user hovers over them or when the close button receives focus, giving more time to read the content. When the mouse leaves or focus moves away, the timer resets and begins counting down again.

The Close Button

Link to This Section

Every toast item includes a close button that allows users to dismiss the notification. When duration is greater than 0, the close button displays a progress ring showing the remaining time.

Click the close button on the right to dismiss →
<wa-toast-item variant="neutral" duration="0">
  <wa-icon slot="icon" name="circle-info"></wa-icon>
  Click the close button on the right to dismiss →
</wa-toast-item>

Customizing the Accent

Link to This Section

Use the --accent-width custom property to adjust the width of the accent line, or hide it entirely.

Thicker accent line No accent line
<div class="wa-stack">
  <wa-toast-item variant="brand" duration="0" style="--accent-width: 8px;">
    <wa-icon slot="icon" name="star"></wa-icon>
    Thicker accent line
  </wa-toast-item>

  <wa-toast-item variant="success" duration="0" style="--accent-width: 0;">
    <wa-icon slot="icon" name="check"></wa-icon>
    No accent line
  </wa-toast-item>
</div>

Customizing the Padding

Link to This Section

Use the --padding custom property to adjust the internal spacing.

Compact padding Spacious padding
<div class="wa-stack">
  <wa-toast-item variant="brand" duration="0" style="--padding: var(--wa-space-xs);">
    <wa-icon slot="icon" name="compress"></wa-icon>
    Compact padding
  </wa-toast-item>

  <wa-toast-item variant="brand" duration="0" style="--padding: var(--wa-space-xl);">
    <wa-icon slot="icon" name="expand"></wa-icon>
    Spacious padding
  </wa-toast-item>
</div>

API

Link to This Section

Importing

Link to This Section

If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick a component manually, use one of the following snippets.

CDN npm Self-Hosted React

Import this component directly from the CDN:

import 'https://ka-f.webawesome.com/[email protected]/components/toast-item/toast-item.js';

After installing Web Awesome via npm, import this component:

import '@awesome.me/webawesome/dist/components/toast-item/toast-item.js';

If you're self-hosting Web Awesome, import this component from your server:

import './webawesome/dist/components/toast-item/toast-item.js';

To import this component for React 18 or below, use the following code:

import WaToastItem from '@awesome.me/webawesome/dist/react/toast-item/index.js';

Slots

Link to This Section

Learn more about using slots.

Name Description
(default) The toast item's message content.
icon An optional icon to show at the start of the toast item.

Attributes & Properties

Link to This Section

Learn more about attributes and properties.

Name Description Reflects
duration
duration
The length of time in milliseconds before the toast item is automatically dismissed. Set to 0 to keep the toast item open until the user dismisses it.
Type number
Default 5000
size
size
The toast item's size.
Type 'xs' | 's' | 'm' | 'l' | 'xl' | 'small' | 'medium' | 'large'
Default 'm'
variant
variant
The toast item's variant.
Type 'brand' | 'success' | 'warning' | 'danger' | 'neutral'
Default 'neutral'
withIcon
with-icon
Only required for SSR. Set to true if you're slotting in an icon element so the server-rendered markup includes the icon before the component hydrates on the client.
Type boolean
Default false

Methods

Link to This Section

Learn more about methods.

Name Description Arguments
hide() Hides the toast item with animation and removes it from the DOM.

Events

Link to This Section

Learn more about events.

Name Description
wa-after-hide Emitted after the toast item has finished hiding.
wa-after-show Emitted after the toast item has finished showing.
wa-hide Emitted when the toast item begins to hide.
wa-show Emitted when the toast item begins to show.

CSS Custom Properties

Link to This Section

Learn more about CSS custom properties.

Name Description
--accent-width
The width of the accent line. Defaults to 4px.
--hide-duration
The animation duration when hiding.
Default var(--wa-transition-normal)
--padding
The internal spacing of the toast item. Scales with the size attribute.
--show-duration
The animation duration when showing.
Default var(--wa-transition-normal)

CSS Parts

Link to This Section

Learn more about CSS parts.

Name Description CSS selector
accent The colored accent line on the start side. ::part(accent)
close-button The close button element. ::part(close-button)
close-icon The close icon element. ::part(close-icon)
close-icon__svg The close icon's exported svg part. ::part(close-icon__svg)
content The message content container. ::part(content)
icon The icon container. ::part(icon)
progress-ring The progress ring component. ::part(progress-ring)
progress-ring__base The progress ring's exported base part. ::part(progress-ring__base)
progress-ring__indicator The progress ring's exported indicator part. ::part(progress-ring__indicator)
progress-ring__label The progress ring's exported label part. ::part(progress-ring__label)
progress-ring__track The progress ring's exported track part. ::part(progress-ring__track)
toast-item The toast item's main container. ::part(toast-item)

Dependencies

Link to This Section

This component automatically imports the following elements. Sub-dependencies, if any exist, will also be included in this list.

  • <wa-icon>
  • <wa-progress-ring>
Need a hand? Report a bug Ask for help
Go Make Something Awesome
Version 3.10.0 © Fonticons, Inc.
  • Terms
  • Privacy
  • Refunds
  • Core License
  • Pro License

Quick Links

  • Components
  • CSS Utilities
  • Theming
  • Using with AI
  • Changelog
  • Help & Support

Recent Searches

    D'oh! No results for “”

    Suggest on GitHub Ask on Discord
    Navigate Select
    Close Esc

    We Have Cookies…

    We use cookies to make webawesome.com work better by storing limited information about your usage.

    We value your privacy, so we won't use them for evil or ask you to join the dark side.

    Customize
    Necessary Only Accept All
    Strictly Necessary
    Required to make the site function correctly — cannot be turned off
    Functionality Analytics
    Cancel Confirm Cookie Choices