Components

Toast

Notification toast system with auto-dismiss

Overview

Toast is a notification toast system. ToastContainer renders toasts in the top-right corner of the screen via a Portal.

  • 4 types — success, error, warning, info
  • Auto-dismiss — Automatically disappears after 4 seconds
  • Animation — Slide in/out from the right
  • Accessible — role="alert", aria-live applied

Basic Usage

Toast Types

TypeUse CaseARIA
successSuccess notificationaria-live="polite"
errorError notificationaria-live="assertive"
warningWarning notificationaria-live="polite"
infoInformational notificationaria-live="polite"

Colors

Each type has its own background, text, border and icon tokens. In light mode the background is tinted; in dark mode every toast sits on the same neutral surface and only the text, border and icon carry the color, because deep tinted backgrounds turn muddy in the dark (yellow becomes olive).

TypeBackgroundText / border / iconClose button hover
errorbackground.toast.errortext/border/icon.danger.defaultbackground.toast.errorHover
successbackground.toast.successtext/border/icon.success.defaultbackground.toast.successHover
warningbackground.toast.warningtext/border/icon.warning.defaultbackground.toast.warningHover
infobackground.toast.infotext.brand.default, border.brand.tertiarybackground.toast.infoHover

The close button is a 16px Close icon inside a 24×24 hit area. Its hover background is one step deeper than the toast, not gray.

Components

ToastContainer

PropTypeDefaultRequiredDescription
toasts{ id: string; type: ToastType; message: ReactNode }[]-YesToasts on screen
onRemove(id: string) => void-YesCalled after a toast has closed. Remove it from the list here
classNamestring-NoExtra CSS class

Position: top-right of screen (space.400 from the top and right edges). Returns null when there are no toasts.

ToastItem

PropTypeDefaultRequiredDescription
type'error' | 'success' | 'warning' | 'info'-NoKind of notice. Changes the colors and aria-live
idstring-YesToast id. Passed to onClose
type'error' | 'success' | 'warning' | 'info'-YesKind of notice
messageReactNode-YesMessage
onClose(id: string) => void-YesCalled after the exit animation when it closes (close button or 4 seconds)

Behavior

  • Enter: Slide in from right, 200ms ease-out
  • Exit: Slide out to right, 150ms ease-in
  • Auto-dismiss: Automatically exits after 4000ms (4 seconds)
  • Manual close: Immediately exits on X button click

Specification

base

상태요소속성값
enabledrootpadding$size.space.300
enabledrootgap$size.space.200
enabledrootborderRadius$size.radius.200
enabledrootborderWidth$size.stroke.border
enabledmessagetypography$text.bodySmall
enabledclosepadding$size.space.100
enabledcloseborderRadius$size.radius.100

type=error

상태요소속성값
enabledrootbackgroundColor$color.background.toast.error
enabledrootborderColor$color.border.danger.default
enabledmessagecolor$color.text.danger.default
enabledclosecolor$color.icon.danger.default
hoverclosebackgroundColor$color.background.toast.errorHover

type=success

상태요소속성값
enabledrootbackgroundColor$color.background.toast.success
enabledrootborderColor$color.border.success.default
enabledmessagecolor$color.text.success.default
enabledclosecolor$color.icon.success.default
hoverclosebackgroundColor$color.background.toast.successHover

type=warning

상태요소속성값
enabledrootbackgroundColor$color.background.toast.warning
enabledrootborderColor$color.border.warning.default
enabledmessagecolor$color.text.warning.default
enabledclosecolor$color.icon.warning.default
hoverclosebackgroundColor$color.background.toast.warningHover

type=info

상태요소속성값
enabledrootbackgroundColor$color.background.toast.info
enabledrootborderColor$color.border.brand.tertiary
enabledmessagecolor$color.text.brand.default
enabledclosecolor$color.icon.brand.default
hoverclosebackgroundColor$color.background.toast.infoHover

Guidelines

  • Place ToastContainer at the app root only once
  • Only error type uses aria-live="assertive" — screen readers announce it immediately
  • Use for short, clear notifications rather than long messages