0.0.4 • Published 4 months ago
popwave v0.0.4
custom-toaster
A lightweight, clean, and interactive toast notification library for Vanilla JavaScript/TypeScript projects. No dependencies required.
Features
- Simple and modern UI with smooth animations
- Beginner Friendly
- Supports
success
,error
,info
, andwarning
toast types - Light weight > 50kb
- Customizable duration
- TypeScript support
- Zero dependencies (if you use Vite)
Installation
Install via npm:
npm install popwave
Usage
import popwave from 'popwave';
popwave.success('Operation completed!');
popwave.error('Something went wrong.', 3000);
popwave.info('Check this out!');
popwave.warning('Be careful!');
API
API | Description | Parameters |
---|---|---|
show | Displays a custom notification | { message, type?, duration? } |
success | Shows a success notification | message, duration? |
error | Shows an error notification | message, duration? |
info | Shows an info notification | message, duration? |
warning | Shows a warning notification | message, duration? |
message
: String (required) - The text to display in the notification.type
:'success' | 'error' | 'info' | 'warning'
(optional) - The notification style (default:'info'
forshow
).duration
: Number (optional) - Time in milliseconds before auto-dismissal (default:5000
).