🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

multi-position-toaster

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multi-position-toaster

A powerful toast notification library with 9 positioning options, themes, and smooth animations

latest
Source
npmnpm
Version
1.0.9
Version published
Maintainers
1
Created
Source

🍞 Multi-Position Toaster

A powerful, customizable toast notification library with 9 positioning options, smooth animations, and complete theme control.

Live Demo | Documentation | Examples

npm version bundle size license

✨ Features

  • 🎯 9 Position Options - Display toasts anywhere on screen
  • Smooth Animations - Slide, fade, or bounce with 60fps performance
  • 🎨 Theme Support - Light, dark, and custom themes
  • 📱 Fully Responsive - Perfect mobile experience
  • 🔧 TypeScript Support - Full type definitions included
  • 🚀 Lightweight - Under 8KB gzipped, zero dependencies
  • Accessible - ARIA labels and keyboard support
  • 🎛️ Highly Customizable - Configure every aspect

📦 Installation

npm install multi-position-toaster

Or use via CDN:

<script src="https://unpkg.com/multi-position-toaster/dist/toaster.min.js"></script>

🚀 Quick Start

import { success, error, topLeft, center } from 'multi-position-toaster';

// Simple usage
success('Operation completed!');
error('Something went wrong!');

// Position-specific
topLeft('Hello from top-left!');
center('Centered message!');

📍 All Available Positions

import { 
  topLeft, topCenter, topRight,
  centerLeft, center, centerRight,
  bottomLeft, bottomCenter, bottomRight 
} from 'multi-position-toaster';

topLeft('Top Left');
topCenter('Top Center');
topRight('Top Right');
centerLeft('Center Left');
center('Center');
centerRight('Center Right');
bottomLeft('Bottom Left');
bottomCenter('Bottom Center');
bottomRight('Bottom Right');

🎨 Advanced Usage

Custom Configuration

import { create } from 'multi-position-toaster';

const toaster = create({
  position: 'top-center',
  theme: 'dark',
  animation: 'bounce',
  maxToasts: 3,
  defaultDuration: 4000,
  pauseOnHover: true
});

toaster.success('Custom configured toast!');

Rich Options

import { show } from 'multi-position-toaster';

show({
  type: 'warning',
  title: 'Warning',
  message: 'This action cannot be undone',
  position: 'center',
  duration: 10000,
  animation: 'bounce',
  pauseOnHover: true,
  progressBar: true,
  onClick: (toast) => {
    console.log('Toast clicked!');
  },
  onClose: (toast) => {
    console.log('Toast closed!');
  }
});

📖 API Reference

Methods

Type-Specific Methods

  • success(message, options?) - Show success toast
  • error(message, options?) - Show error toast
  • warning(message, options?) - Show warning toast
  • info(message, options?) - Show info toast

Position Methods

  • topLeft(message, options?)
  • topCenter(message, options?)
  • topRight(message, options?)
  • centerLeft(message, options?)
  • center(message, options?)
  • centerRight(message, options?)
  • bottomLeft(message, options?)
  • bottomCenter(message, options?)
  • bottomRight(message, options?)

Utility Methods

  • show(options) - Show toast with full configuration
  • clear(position?) - Clear toasts (all or by position)
  • setDefaults(options) - Set global defaults
  • setTheme(theme) - Change theme dynamically
  • create(options) - Create new toaster instance

Configuration Options

OptionTypeDefaultDescription
positionstring'top-right'Toast position on screen
themestring'light'Theme: 'light' or 'dark'
maxToastsnumber5Max toasts per position
defaultDurationnumber5000Default duration in ms
animationstring'slide'Animation type
stackDirectionstring'down'Stack direction: 'up' or 'down'
pauseOnHoverbooleantruePause on hover
progressBarbooleantrueShow progress bar

Toast Options

OptionTypeDefaultDescription
typestring'info''success', 'error', 'warning', 'info'
titlestring''Toast title
messagestring''Toast message (required)
durationnumber5000Duration in ms (0 = no auto-dismiss)
positionstring-Override default position
closablebooleantrueShow close button
onClickfunctionnullClick callback
onClosefunctionnullClose callback

🎯 Use Cases

E-commerce

import { topRight, bottomCenter } from 'multi-position-toaster';

// Cart updates
topRight('Item added to cart!', { type: 'success' });

// Checkout
bottomCenter('Processing payment...', { type: 'info', duration: 0 });

Form Validation

import { topCenter } from 'multi-position-toaster';

topCenter('Please enter a valid email', { 
  type: 'error',
  duration: 4000 
});

Real-time Notifications

import { create } from 'multi-position-toaster';

const notifier = create({
  position: 'bottom-left',
  theme: 'dark',
  maxToasts: 3
});

// WebSocket messages
socket.on('message', (data) => {
  notifier.info(data.text);
});

🌐 Browser Support

  • Chrome 60+
  • Firefox 55+
  • Safari 12+
  • Edge 79+
  • Opera 47+

📄 License

MIT © Kunal Risaanva

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📧 Support

Made with ❤️ for developers who care about UX

Keywords

toast

FAQs

Package last updated on 16 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts