1.0.0 • Published 8 months ago
mandy-toast v1.0.0
Simple Toast Notify
A lightweight, customizable toast notification library for web applications.
Installation
npm install simple-toast-notify
Usage
import { Toast } from 'simple-toast-notify';
// Basic usage
Toast.show({
message: 'Hello World!'
});
// With custom options
Toast.show({
message: 'Operation successful!',
position: 'top-right',
type: 'success',
duration: 5000,
backgroundColor: '#4caf50',
textColor: '#ffffff'
});
Options
Option | Type | Default | Description |
---|---|---|---|
message | string | required | The message to display |
position | 'top-left' | 'top-right' | 'middle' | 'bottom-left' | 'bottom-right' | 'top-right' | Position of the toast |
type | 'success' | 'error' | 'warning' | 'info' | 'info' | Predefined toast types |
backgroundColor | string | Based on type | Custom background color |
textColor | string | Based on type | Custom text color |
duration | number | 3000 | Duration in milliseconds |
Features
- 🎨 Customizable colors and positions
- 🎯 TypeScript support with full type definitions
- 🚀 Lightweight with zero dependencies
- 💫 Smooth animations
- 📱 Responsive design
- 🎭 Pre-defined themes (success, error, warning, info)
License
MIT
1.0.0
8 months ago