How github-suriya/vanilla-toast-js works
Vanilla Toast is a framework-independent browser notification library. Its main workflow is an application calling the exported toast API, which delegates to the toaster to create and manage positioned DOM notifications; queue state, animation, theme, and gesture helpers support that runtime. Promise-based notifications, custom toasts, updates, dismissal, accessibility, and configuration are documented capabilities. Edges reflect the shown imports and calls; capabilities documented in the README but not individually visible in excerpts are represented at the API level.
Main entry points: toaster.ts Toaster Engine · index.ts Package Entry · utils.ts DOM Utilities · toast.ts Toast API
Components 11
Public API
- Package Entry
src/index.ts - Toast API
src/toast.ts - API Types
src/types.ts
Toast Runtime
- Toaster Engine
src/toaster.ts - Toast Styles
src/styles/vanilla-toast.css
Runtime Helpers
- Toast Queue
src/queue.ts - Stack Animation
src/animations.ts - Swipe Gestures
src/gestures.ts - Theme Resolution
src/theme.ts - DOM Utilities
src/utils.ts
Other components
- Application
Connections 11
- Application → Package Entry: imports or loads
README.md - Package Entry → Toast API: exports and exposes
src/index.ts - Package Entry → Toast Styles: imports
src/index.ts - Toast API → Toaster Engine: delegates API calls
src/toast.ts - Toaster Engine → Toast Queue: manages toast state
src/toaster.ts - Toaster Engine → Stack Animation: mounts and lays out
src/toaster.ts - Toaster Engine → Swipe Gestures: binds swipe
src/toaster.ts - Toaster Engine → Theme Resolution: applies theme
src/toaster.ts - Toaster Engine → DOM Utilities: uses DOM helpers
src/toaster.ts - Stack Animation → DOM Utilities: uses position helpers
src/animations.ts - Swipe Gestures → DOM Utilities: clamps movement
src/gestures.ts