Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-simple-toasts

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simple-toasts

React Simple Toasts is a simple and easy-to-use toast message popup for React.

  • 5.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.7K
increased by19.27%
Maintainers
1
Weekly downloads
 
Created
Source

React Simple Toasts 🍞

React Simple Toasts is a lightweight, user-friendly toast message library for React applications.

NPM NPM Downloads Size License

Documentation

Explore the full capabilities of React Simple Toasts and try out live examples in our documentation page.

Key Features

  • Ease of use: With a simple installation process and an intuitive API, you can get started with the library in no time.
  • Highly customizable: You can control various aspects of your toast messages, from their appearance and duration to their behavior upon user interaction.
  • Custom rendering: The library supports custom rendering, allowing you to tailor the look of your toast messages to match your application's branding.
  • Positioning: The library allows you to position your toasts at any corner or center of the viewport, offering a high level of control over where your messages appear.
  • Browser compatibility: The library includes utility functions to ensure that it works seamlessly across different browsers.
  • Interactive: The library allows toasts to be clickable and to close on click if desired, enabling user interaction.
  • Multiple toasts management: It provides functionality to manage multiple toasts by controlling the maximum number of visible toasts at a time.

Table of Contents

Installation

Install the package via npm:

npm install react-simple-toasts

Usage

Import and call the toast function with a message to display:

import toast from 'react-simple-toasts';
import 'react-simple-toasts/dist/theme/dark.css'; // import the desired theme

// specify the theme in toastConfig
toastConfig({
  theme: 'dark',
});

function MyComponent() {
  return <button onClick={() => toast('Hello, world!')}>Display Toast</button>;
}

API

toast(message, options)

Displays a toast message with the specified message and options. Detailed options can be found on our documentation page.

Toast Return Object

The toast function returns a control object with methods to manage the displayed toast. You can find examples of usage on our documentation page.

Configuring Toasts: createToast and toastConfig

The createToast and toastConfig functions allow for advanced configuration of your toast notifications. Use createToast to generate a toast function with specific settings, and toastConfig to set default options for all toast messages in your application. See our documentation page for more details.

Contributing

Contributions are always welcome!

Support Us

If you find this library useful, consider giving us a star on GitHub! Your support is greatly appreciated and it helps the project grow.

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 13 Jul 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc