Purpose

Toasts are used to show confirmations of user action.

Dos

  • Keep messaging clear and short

Don’ts

  • Show more than one toast at a time
  • Use for warning or error alerts (instead, use NotificationBar)

Variants

Toasts should behave and appear consistently within a platform and also respect the unique context and needs of each platform. Each platform has its own Toast variant as a result.

  • chrome-extension toasts will come down from the top of the screen to keep it near the recorder itself.
  • web-app toasts come up from the bottom center of the screen, which interferes with other web-app features the least and a standard industry practice.

Usage

import {Toast} from '@loomhq/lens'
<Toast>Content</Toast>

Examples

Simple toast

Toast with custom content

Toast with longer timeout

Toast in chrome extension

Props

name
type
default
zIndex
number
1100
duration
'short' | 'long'
'short'
platform
'web-app' | 'chrome-extension'
'web-app'
children
React.ReactNode
isOpen
boolean
onCloseClick
() => void