# Install
bun add notifyx
# Import
import NotifyX from 'notifyx';
import 'notifyx/dist/notifyx.min.css';// Simple notifications
NotifyX.success('Success!');
NotifyX.error('Error occurred');
NotifyX.warning('Warning!');
NotifyX.info('FYI');
// Advanced
NotifyX.show({
message: 'Custom message',
type: 'success',
duration: 5000,
position: 'bottom-right',
dismissible: true,
onClose: () => console.log('Closed')
});
// Clear all
NotifyX.clear();import NotifyX, { ToastOptions, ToastType, Position, POSITIONS } from 'notifyx';
const options: ToastOptions = {
message: 'Hello',
type: 'info',
position: POSITIONS.TOP_RIGHT
};git clone https://github.com/awalhadi/notifyx.git
cd notifyx
bun installbun run dev # Start dev server
bun run build:all # Build everything
bun run verify # Verify build- Use
constoverlet - Functions < 20 lines
- JSDoc for public APIs
- Single responsibility
- Type inference
# 1. Build
bun run build:all
# 2. Verify
bun run verify
# 3. Check sizes
ls -lh dist/
# 4. Commit
git commit -m "feat: your feature"src/index.ts- Main entry pointsrc/types/index.ts- Type definitionssrc/utils/dom.ts- DOM utilitiessrc/constants/- Static values
README.md- User documentationARCHITECTURE.md- Design & structureCONTRIBUTING.md- Developer guideCHANGELOG.md- Version history
package.json- Package configtsconfig.json- TypeScript configvite.config.ts- Build config
dist/notifyx.es.js- ESM bundledist/notifyx.min.js- UMD bundledist/notifyx.min.css- Stylesdist/index.d.ts- Type definitions
| File | Size | Gzipped |
|---|---|---|
| UMD JS | 3.2 KB | 1.4 KB |
| ESM JS | 6.6 KB | 1.9 KB |
| CSS | 16 KB | 3.7 KB |
✅ Framework agnostic
✅ TypeScript support
✅ Zero dependencies
✅ Tiny bundle (1.4KB gzipped)
✅ Tree-shakeable
✅ Accessible (ARIA)
✅ Dark mode ready
- Update
ToastTypeinsrc/types/index.ts - Add method in
src/index.ts - Add styles in
src/styles/toast.css - Update docs
- Update
ToastOptionsinterface - Update
DEFAULT_OPTIONSif needed - Use in implementation
- Add JSDoc
- Update README
- Use
Mapfor caching - Minimize DOM queries
- Batch updates
- CSS animations > JS
NotifyX (static class)
├── Public methods (show, success, error, etc.)
└── Private helpers (DOM, events, timers)
DOM Utilities
├── Container creation
├── Container caching (Map)
└── Accessibility (ARIA)
Constants
├── POSITIONS
├── ANIMATION_CLASSES
└── DEFAULT_OPTIONS
Types
├── ToastType
├── ToastOptions
├── Position
└── NormalizedToastOptions (internal)
graph LR
A[src/**/*.ts] --> B[Vite + Terser]
B --> C[dist/notifyx.es.js]
B --> D[dist/notifyx.min.js]
E[src/styles/*.css] --> F[Tailwind CLI]
F --> G[dist/notifyx.min.css]
A --> H[vite-plugin-dts]
H --> I[dist/index.d.ts]
# Development
bun run dev # Dev server (localhost:5173)
# Build
bun run build # Build JS only
bun run build:css # Build CSS only
bun run build:all # Build everything
# Verification
bun run verify # Run verification script
# Publishing (maintainers only)
npm version patch # Bump version
npm publish # Publish to npm- 📖 Check
README.mdfor usage examples - 🏗️ Check
ARCHITECTURE.mdfor design details - 🤝 Check
CONTRIBUTING.mdfor dev guidelines - 📋 Check
CHANGELOG.mdfor version history
License: MIT
Author: A Awal Hadi
Version: 2.2.35+