Introduction
A provider-scoped toast runtime and facade for React.
@ilokesto/toast
@ilokesto/toast is a React toast package built around a provider-scoped runtime and a familiar toast.* facade. Internally it uses @ilokesto/overlay only for presence lifecycle, while toast policy and rendering stay inside this package.
What this package gives you
- A familiar facade:
toast(),toast.success(),toast.error(),toast.loading(),toast.custom(),toast.promise() - Independent runtimes separated by
toasterId - A default
Toasterwith built-in row rendering - Headless hooks for custom rendering
- Optional
transport="top-layer"
What it intentionally does not give you
- No global singleton that works without a mounted
Toaster - No notification center or inbox model
- No attempt to hide that a runtime registry exists behind the facade
Quick Look
import { Toaster, toast } from '@ilokesto/toast';
function App() {
return (
<>
<button onClick={() => toast.success('Saved successfully')}>Show toast</button>
<Toaster />
</>
);
}Start Here
- Quick Start: the shortest path to showing your first toast
- Mental Model: facade/runtime split,
toasterId, and overlay presence - API Reference: the exact public surface
Go Deeper
- Toaster: runtime view props and rendering behavior
- ToastBar: the default row primitive
- Headless Usage:
useToaster()anduseToastItems() - Migration: practical move from
react-hot-toast - Implementation Notes: timers, registry, and overlay mirror details