How fkhadra/react-toastify works
React-Toastify is a React notification library. An application calls the public toast API; the core queues or dispatches notifications to registered containers, which observe state and render toast components with interaction, timing, progress, and transition behavior. The README documents additional capabilities such as promise notifications, updates, stacking, RTL, and customization. The graph follows the sampled calls and README capabilities; unsampled subsystem links are omitted where their wiring cannot be verified.
Main entry points: Toast.tsx Toast View · store.ts Toast Store · toast.ts Toast API · ToastContainer.tsx Toast Container
Components 17
Public API
- Library Exports
src/index.ts - Toast API
src/core/toast.ts
Toast State
- Toast Store
src/core/store.ts - Container Observer
src/core/containerObserver.ts
Rendering
- Toast Container
src/components/ToastContainer.tsx - Container Hook
src/hooks/useToastContainer.ts - Toast View
src/components/Toast.tsx - Close Button
src/components/CloseButton.tsx - Progress Bar
src/components/ProgressBar.tsx - Toast Icons
src/components/Icons.tsx
Interaction & Motion
- Transition Components
src/components/Transitions.tsx - Toast Interaction
src/hooks/useToast.ts - CSS Transitions
src/utils/cssTransition.tsx - Toast Collapse
src/utils/collapseToast.ts
Extensions
- Notification Center Hook
packages/use-notification-center/src/useNotificationCenter.ts - Configuration Playground
playground/src/components/App.tsx
Other components
- Application
Connections 20
- Application → Library Exports: uses API
- Library Exports → Toast API: exports
src/index.ts - Toast API → Toast Store: dispatches toast
src/core/toast.ts - Toast Container → Container Hook: observes state
src/components/ToastContainer.tsx - Container Hook → Toast Store: registers container
src/hooks/useToastContainer.ts - Toast Store → Container Observer: creates observer
src/core/store.ts - Toast Store → Container Observer: dispatches toast
src/core/store.ts - Toast Container → Toast View: renders toasts
src/components/ToastContainer.tsx - Toast View → Toast Interaction: uses interaction
src/components/Toast.tsx - Toast View → Close Button: renders close
src/components/Toast.tsx - Toast View → Progress Bar: renders progress
src/components/Toast.tsx - Toast View → Toast Icons: gets icon
src/components/Toast.tsx - Toast View → Transition Components: renders transition
src/components/Toast.tsx - CSS Transitions → Toast Collapse: collapses toast
src/utils/cssTransition.tsx - Toast API → Notification Center Hook: feeds notifications
- Application → Configuration Playground: configures demo
playground/src/components/App.tsx - Configuration Playground → Library Exports: calls toast API
playground/src/components/App.tsx - Application → Toast Container: mounts containers
- Application → Toast API: creates promise toast
- Toast Interaction → Toast Store: registers timer
src/hooks/useToast.ts