diff --git a/README.md b/README.md index f59ef2c..8503083 100644 --- a/README.md +++ b/README.md @@ -11,22 +11,35 @@ React Simple Toasts is a lightweight, user-friendly toast message library for Re
+## Documentation + +Explore the full capabilities of React Simple Toasts and try out live examples in our [documentation page](https://almond-bongbong.github.io/react-simple-toasts/). + +## 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](#installation) - [Usage](#usage) -- [Live Demo](#live-demo) - [API](#api) - [toast(message, options)](#toastmessage-options) - [Toast Return Object](#toast-return-object) - - [createToast(options)](#createtoastoptions) - - [toastConfig(options)](#toastconfigoptions) + - [Configuring Toasts: createToast and toastConfig](#configuring-toasts-createtoast-and-toastconfig) - [Contributing](#contributing) +- [Support Us](#support-us) - [License](#license) ## Installation -To install the package via npm, run: +Install the package via npm: ```sh npm install react-simple-toasts @@ -34,7 +47,7 @@ npm install react-simple-toasts ## Usage -To utilize React Simple Toasts, invoke the toast function with a message to display: +Import and call the toast function with a message to display: ```jsx import toast from 'react-simple-toasts'; @@ -44,188 +57,27 @@ function MyComponent() { } ``` -By default, the toast message is displayed for 3 seconds. Modify the duration by providing a second argument to the `toast` function: - -```jsx -toast('Hello, world!', 5000); -``` - -Adjust the appearance and behavior of the toast message by supplying an options object to the toast function: - -```jsx -toast('Hello, world!', { - duration: 5000, - position: 'top-right', - clickable: true, - clickClosable: true, - className: 'custom-toast', - render: (message) =>- React Simple Toasts is a lightweight and versatile toast notification - library for React applications. -
- -- Display a straightforward toast notification with default settings. -
-- Leverage JSX to design more intricate and customizable toast - notifications. This example showcases how to include JSX elements - and apply inline styles within the message. -
-- Determine the duration for which the toast notification remains - visible. This example demonstrates how to display a toast - notification for a specific duration. -
-- Clear all toast notifications. This example demonstrates how to - clear all toast notifications. -
-- As an alternative, you can use the "duration" option to specify the - display duration. -
-- Select the desired position of the toast notification on the screen. - This example demonstrates how to display toast notifications in - various positions. -
- -- Create a toast notification that can be dismissed by clicking on it. - This example demonstrates a toast with the "clickClosable" option - set to true. -
-- Modify the appearance of the toast notification using the "render" - option. In this example, the toast notification will display red - text. -
-- Establish global configurations to apply default settings to all - toast notifications in your application. -
-- Limit the number of toast notifications displayed at the same time. -
-Apply maxVisibleToasts directly in the toast function.
-- In this example, we use the Toast object to display and close a - toast with an infinite duration. -
- -- In this example, we use the Toast object's 'updateDuration' method - to update the duration of a toast message. -
- -- In this example, we use the Toast object's 'update' method to update - the message and duration of a toast message. -
- -