feedback/@mihcm/ui·v0.21.0·stable
Toast
Brief non-blocking notification that auto-dismisses. Imperative toast() API with semantic variants, appearance styles, and configurable duration.
Props
The full prop API for Toast. Same surface in web and React Native — bundlers pick the right variant via the react-native export condition.
| Prop | Type | Default | Description | Since |
|---|---|---|---|---|
title | string | — | Primary toast message. Required. | 0.5.0 |
description | string | — | Optional secondary text below the title. | 0.5.0 |
variant | 'default' | 'success' | 'error' | 'warning' | 'accent' | 'default' | Visual variant. Drives left-border color and aria-live mode. | 0.5.0 |
appearance | 'soft' | 'solid' | 'outline' | 'minimal' | 'soft' | Visual treatment for a specific toast. Provider can also set the default appearance. | 0.10.1 |
ToastProvider.appearance | 'soft' | 'solid' | 'outline' | 'minimal' | 'soft' | Default visual treatment for toasts without an explicit appearance. | 0.10.1 |
duration | number | 5000 | Auto-dismiss delay in milliseconds. Timer pauses on hover. | 0.5.0 |
action | { label: string; onClick: () => void } | — | Optional action button rendered inside the toast. | 0.5.0 |
Upstream library
This component intentionally keeps the MiHCM API small while preserving the supported upstream behavior listed below. Use these links when you need the full underlying option surface.
- sonner documentation — Toaster + toast are sonner under MiHCM theming. Use upstream docs for the full feature surface (promise, custom JSX, expand-on-hover, swipe, RTL, theme).
- sonner GitHub — Source + release notes by Emil Kowalski. Open upstream issues here.
Import
import { ToastProvider, toast } from '@mihcm/ui/Toast';