toastory v0.1.0•Zero Dependencies•5.2 KB gzip

All UI feedback in one package. Apple-style glass.

Toasts, confirm / alert / prompt dialogs, bottom sheets, and loading overlays. One identical API across plain JS, React, Next.js, Vue, Nuxt, Angular, Svelte, and React Native.

npm install toastory
✓ WCAG 2.2 AA (0 axe errors)•✓ TypeScript Strict•✓ npm Provenance•✓ Tree-shakable CSS & JS
Interactive Glass Dogfooding Demo
Stack:
Placement:
Dismiss all:

Every platform. One identical API.

Switch from React to Svelte, Next.js to React Native, or Vanilla JS to Vue without rewriting options, parameters, or themes.

npm install toastory0 dependencies
App.tsx
import { Toaster, toast, ui } from 'toastory/react';
import 'toastory/themes/ios-glass.css';

export default function App() {
  return (
    <>
      <Toaster position="top-right" theme="ios-glass" />
      <button onClick={() => toast.success('Saved to cloud!')}>Notify</button>
      <button onClick={() => ui.confirm({ title: 'Logout?' })}>Sign Out</button>
    </>
  );
}
Feature 01

Toasts: Types, Promises, Actions & Stacking

Polite live regions, actionable Undo buttons, 4-direction swipe dismissal, and automatic deduplication windows.

Standard Toast

Rich icons, titles, secondary descriptions, and auto-dismiss timing.

Action & Undo Bar

Inline actionable buttons with visible keyboard focus rings.

Async Promise Toast

Tracks Promise resolution with loading spinner and automatic unwrapping.

Determinate Progress

Smooth progress tracks and rings with pausable hover/focus states.

Feature 02

Dialogs: Confirm, Prompts, OTP & Steps

SweetAlert2 replacement with Apple glass styling. Built-in focus trap, 16 input types, type-to-confirm guards, and drawer bottom sheets.

Danger Destructive Confirm

Modal confirmation with default focus lock on Cancel button to protect accidental deletions.

Type-to-Confirm Guard

Disables the confirmation button until the user exactly types the specified confirmation string.

6-Box Discrete OTP Input

Auto-advances between numeric inputs, clipboard paste parsing, and live resend timer countdown.

Session Inactivity Countdown

Real-time ticking seconds display with animated timer track and pause/resume hooks.

Multi-Step Wizard (`ui.steps`)

Sequential wizard dialog with back/forward history and aggregated results.

Mobile Bottom Sheet & Action Sheet

Swipeable gesture drawer with configurable snap points and drag handles.

Feature 03

Live Design Token Customiser

Adjust CSS variables live. Watch the toast restyle instantly and export the ready CSS token overrides.

Generated CSS Token Output
theme-override.css
/* Generated Theme Overrides */
[data-gk-theme="custom"] {
  --gk-accent: #3b82f6;
  --gk-radius: 20px;
  --gk-blur: 22px;
}
WCAG 2.2 AA

Accessibility & Live Regions

Standard toasts announce politely with `role="status"` and `aria-live="polite"`. Error notices escalate to `role="alert"` and `aria-live="assertive"`. Active dialogs trap keyboard focus and restore focus on dismiss.

Focus Navigation Hotkey:Alt + T
Reduced Motion Preference:
Verifiable Benchmarks

Ultra-lightweight Size Budget

Core + Toast + 1 Theme5.20 KB (budget < 6.00 KB)
Full Web Bundle (All Dialogs)14.10 KB (budget < 22.00 KB)
Runtime Dependencies0 Bytes (Zero Dependencies)
Measured via `esbuild --bundle --minify` with `gzipSync`. Verified 2026.

Honest, Verifiable Feature Comparison

Measured via automated build tests and repository analysis. Facts are checked against official documentation.

Feature & SpecificationtoastorySonnerReact-Toastifyreact-hot-toastNotyfSweetAlert2
Zero Runtime DependenciesYes (0 B)NoNoNoYesYes
Measured Gzip Size (Core + Toast)5.2 KB~4.5 KB~14.0 KB~5.2 KB~3.8 KB~15.0 KB
Frameworks SupportedJS, React, Next, Vue, Nuxt, Angular, Svelte, RNReact onlyReact onlyReact onlyVanilla onlyVanilla / Wrappers
Dialog Toolkit (Confirm, Prompt, Alert)✓————✓
Mobile Bottom Sheet & Action Sheet✓—————
Multi-Step Wizard Dialogs✓————Basic
6-Box Discrete Numeric OTP Input✓—————
Type-to-Confirm Deletion Guard✓—————
Real-time Session Countdown Timer✓————Timer only
Apple-Style Frosted Glass Tokens21 ThemesFlat minimalFlat cardMinimal cardFlat bannerFlat / Skewed
Gesture Swipe Physics (4-Direction)✓1-Direction2-DirectionBasic——
WCAG 2.2 AA Verified (0 axe-core errors)Yes (96 runs)not verifiednot verifiednot verifiednot verifiednot verified
LicenseMITMITMITMITMITMIT
Method: Measured with gzipSync over esbuild standalone bundles. Script: `scripts/size.mjs`.Notice: toastory is not affiliated with any referenced open-source projects.

Migrating from Sonner, SweetAlert2 or React-Toastify?

toastory provides drop-in compatibility patterns with detailed side-by-side option maps so you can replace legacy dependencies in minutes.

Upgrade your UI feedback today.

Zero runtime dependencies. Apple-style frosted glass. Built for accessibility and multi-framework workflows.