Reactolith UI Getting Started Introduction Installation Usage Layout Aspect Ratio Card Resizable Scroll Area Separator Direction Provider Forms Button Button Group Calendar Checkbox Combobox Field Input Input Group Input OTP Label Native Select Radio Group Select Slider Switch Textarea Toggle Toggle Group Data Display Accordion Avatar Badge Carousel Chart Collapsible Item Kbd Table Feedback Alert Empty Progress Skeleton Sonner Spinner Overlay Alert Dialog Context Menu Dialog Dropdown Menu Hover Card Popover Sheet Tooltip Navigation Breadcrumb Command Menubar Navigation Menu Pagination Sidebar Tabs

Sonner

An opinionated toast component for React, built by Emil Kowalski.

Preview

Usage

<!-- Place once in your layout -->
<ui-sonner rich-colors json-toasts='[
  {
    "kind": "success",
    "message": "Profile saved",
    "description": "Your changes have been saved successfully."
  },
  {
    "kind": "info",
    "message": "Welcome back!"
  }
]'></ui-sonner>

Sub-components

<ui-sonner>

Props

<ui-sonner>

PropTypeDefaultDescription
position"top-left" | "top-right" | "bottom-left" | "bottom-right" | "top-center" | "bottom-center""bottom-right"Toast position.
richColorsbooleanfalseUse rich colors.
json-toastsInitialToast[][]Initial toasts to show on mount. Each toast: { id?, kind?: "message" | "success" | "error" | "warning" | "info", message, description? }. Toasts are deduplicated by id.

All components also accept standard HTML attributes (class, id, style, data-*, aria-*, etc.) which are passed through to the underlying element.