Skip to Content
SmartUI

Toast

Short confirmation after an action. It appears, then leaves on its own.

Usage

import { toast, ToastRegion } from '@smartui/react';
import '@smartui/react/styles.css';

When to use

  • Reporting the result of an action.
  • Offering undo for a few seconds.

When not to use

  • Information that must stay. Use Alert.

Props

PropTypeDefaultDescription
toast(message, options)function-Call from anywhere.
options.tone'neutral' | 'success' | 'warning' | 'danger''neutral'
options.durationnumber (ms)4000Danger toasts stay until dismissed.
options.action{ label, onPress }-
<ToastRegion placement>'bottom' | 'top-right''bottom'Mount once near the root.

Accessibility

  • Announced without moving focus.

On this page