ilokesto

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 Toaster with 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

Go Deeper

On this page