MiHCM
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.

PropTypeDefaultDescriptionSince
titlestringPrimary toast message. Required.0.5.0
descriptionstringOptional 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
durationnumber5000Auto-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 documentationToaster + toast are sonner under MiHCM theming. Use upstream docs for the full feature surface (promise, custom JSX, expand-on-hover, swipe, RTL, theme).
  • sonner GitHubSource + release notes by Emil Kowalski. Open upstream issues here.

Import

import { ToastProvider, toast } from '@mihcm/ui/Toast';