For AI agents: the complete documentation index is available at https://rickyshin93.github.io/tao-ui/llms.txt, the full documentation bundle is available at https://rickyshin93.github.io/tao-ui/llms-full.txt, and this page is available as Markdown at https://rickyshin93.github.io/tao-ui/components/sonner.md.
v0.0.57
  • English
  • Sonner

    Feedback@rockshin/tao-ui

    Displays temporary toast notifications with optional actions and provider-aware theming.

    When to use

    Mount one Sonner near app root, then call toast() imperatively from event handlers. Supports toast.loading(), toast.promise(), and toast.custom() for richer async and custom notification flows.

    Recommended

    • Prefer short, status-oriented messages with one primary action at most.
    • Enable richColors when semantic status color should be visible.

    Avoid

    • Do not use toast notifications for blocking confirmations.

    Examples

    Each example runs independently, and notifications stay inside its preview. Applications normally mount one Sonner host.

    Basic usage

    390 × 640
    TSX

    Semantic and rich-color toasts

    390 × 640
    TSX

    Loading and promise lifecycle

    390 × 640
    TSX

    Actions, positions, and stack limits

    390 × 640
    TSX

    Semantic colors

    richColors distinguishes status notifications.

    390 × 640
    TSX

    Notification actions

    action and cancel provide related actions.

    390 × 640
    TSX

    Toast positions

    Choose the toast position; notifications remain inside the preview window.

    390 × 640
    TSX

    Stacking and visible limits

    visibleToasts limits the number of simultaneously visible notifications.

    390 × 640
    TSX

    Toast duration

    Override duration per toast and provide dismissal for persistent messages.

    390 × 640
    TSX

    Submission feedback

    A local delay simulates submission feedback for pending, success, and error states.

    390 × 640
    TSX

    API

    Sonner

    PropertyDescriptionTypeDefault Value
    classNameAdditional css classstring | undefined-
    styleAdditional styleCSSProperties | undefined-

    toast

    PropertyDescriptionTypeDefault Value