0.1.0 • Published 2 years ago
react-toast-library0v v0.1.0
Toast library
Main functionality:
- Show notification.
- Ability to set notification position.
- Ability to set the type of notification (notification of success, error, alert, etc.).
- Ability to set the duration of the notification.
- Ability to set the title and description of the notification.
- Ability to set notification indents.
- Ability to change notification type color.
- Ability to change the animation of appearance and disappearance.
Usage
import React from 'react';
import { ToastContainer, toastStories } from 'react-toast-library0v';
function App(){
return (
<ToastContainer toastPosition={toastPosition}/>
)
}
Add and configuration toast
{
toastStories.setContainer();
toastStories.addToast(
toastType,
size,
toastAutoDelete,
toastAutoDeleteTime,
title,
titleColor,
backgroundColor,
toastAnimation
);
}
Settings:
toastType - set type notification 1. 'error' 2. 'warning' 3. 'success' 4. 'info'
size - set size notifications 1. 'small' 2. 'medium' 3. 'large'
toastAutoDelete - set auto-delete notifications 1. false 2. true
toastAutoDeleteTime - set time auto-delete notifications 1. 0 - infinity
title - set title notifications
titleColor - set a color text
backgroundColor - set color notifications
toastAnimation - set animation a notification 1. 'from-top'
- 'from-bottom'
Settings position ToastContainer:
toastPosition - set notification position 1. 'top-right' 2. 'top-left' 3. 'bottom-right'
- 'bottom-left'
You can try the toast settings on the Homepage