Gathering detailed insights and metrics for react-toastify-redux
Gathering detailed insights and metrics for react-toastify-redux
Gathering detailed insights and metrics for react-toastify-redux
Gathering detailed insights and metrics for react-toastify-redux
npm install react-toastify-redux
Typescript
Module System
Node Version
NPM Version
65.8
Supply Chain
91.5
Quality
75.1
Maintenance
100
Vulnerability
100
License
TypeScript (94.84%)
JavaScript (5.16%)
Total Downloads
150,928
Last Day
1
Last Week
358
Last Month
1,331
Last Year
18,220
MIT License
22 Stars
12 Commits
7 Forks
3 Watchers
2 Branches
2 Contributors
Updated on Jun 23, 2023
Minified
Minified + Gzipped
Latest Version
1.0.0-rc.2
Package Id
react-toastify-redux@1.0.0-rc.2
Unpacked Size
75.85 kB
Size
18.98 kB
File Count
28
NPM Version
5.6.0
Node Version
9.5.0
Cumulative downloads
Total Downloads
Last Day
-50%
1
Compared to previous day
Last Week
39.3%
358
Compared to previous week
Last Month
14.9%
1,331
Compared to previous month
Last Year
-16.3%
18,220
Compared to previous year
4
24
Wraps react-toastify into a component and exposes actions and reducer.
$ npm install --save react-toasify-redux
$ yarn add react-toastify-redux
Import the reducer and pass it to your combineReducers:
1import {combineReducers} from 'redux'; 2import {toastsReducer as toasts} from 'react-toasify-redux'; 3 4export default combineReducers({ 5 // ...other reducers 6 toasts 7});
Include the toast controller in main view:
1import {ToastController} from 'react-toasify-redux'; 2 3export default () => { 4 return ( 5 <div> 6 ... 7 <ToastController /> 8 </div> 9 ); 10};
Use actions for create, update and remove toasts:
1import {dismiss, update, error, message, warning, success, info} from 'react-toastify-redux'; 2 3dispatch(dismiss(id)); 4dispatch(dismiss()); // dismiss all toasts 5dispatch(update(id, options)); 6dispatch(message('Default message')); 7dispatch(success('Success message')); 8dispatch(error('Error message')); 9dispatch(warning('Warning message')); 10dispatch(info('Info message'));
Create toast component
1export default ({ type, message }) => ( 2 <div className='toast'> 3 <div className='header'>{type}</div> 4 <div className='message'>{message}</div> 5 </div> 6);
Include this component in ToastConroller
1import {ToastController} from 'react-toasify-redux'; 2import CustomToastComponent from 'awesome-folder/custom-toast-component'; 3 4export default () => { 5 return ( 6 <div> 7 ... 8 <ToastController toastComponent={CustomToastComponent} /> 9 </div> 10 ); 11};
ToastContainer extends properties from ToastContainer in react-toastify. Also have new properties:
Props | Type | Default | Description |
---|---|---|---|
toastComponent | ComponentClass or false | - | Element that will be displayed after emit toast |
Parameter | Type | Required | Description |
---|---|---|---|
toast id | string | ✘ | Id toast for dismiss. If call action without id, then dismiss all toasts |
Parameter | Type | Required | Description |
---|---|---|---|
toast id | string | ✓ | Id toast for update |
options | object | ✘ | Options listed below |
Parameter | Type | Required | Description |
---|---|---|---|
message | string | ✓ | Message for toast |
options | object | ✘ | Options listed below |
Parameter | Type | Default | Description | |||
---|---|---|---|---|---|---|
renderDefaultComponent | boolean | false | Render default toast component? Use this propery if using custom toast component. | |||
type | sa# React Toastify Redux | |||||
Wraps react-toastify into a component and exposes actions and reducer. |
$ npm install --save react-toasify-redux
$ yarn add react-toastify-redux
Import the reducer and pass it to your combineReducers:
1import {combineReducers} from 'redux'; 2import {toastsReducer as toasts} from 'react-toasify-redux'; 3 4export default combineReducers({ 5 // ...other reducers 6 toasts 7});
Include the toast controller in main view:
1import {ToastController} from 'react-toasify-redux'; 2 3export default () => { 4 return ( 5 <div> 6 ... 7 <ToastController /> 8 </div> 9 ); 10};
Use actions for create, update and remove toasts:
1import {dismiss, update, error, message, warning, success, info} from 'react-toastify-redux'; 2 3dispatch(dismiss(id)); 4dispatch(dismiss()); // dismiss all toasts 5dispatch(update(id, options)); 6dispatch(message('Default message')); 7dispatch(success('Success message')); 8dispatch(error('Error message')); 9dispatch(warning('Warning message')); 10dispatch(info('Info message'));
Create toast component
1export default ({ title, message }) => ( 2 <div className='toast'> 3 <div className='header'>{title}</div> 4 <div className='message'>{message}</div> 5 </div> 6);
Include this component in ToastConroller
1import {ToastController} from 'react-toasify-redux'; 2import CustomToastComponent from 'awesome-folder/custom-toast-component'; 3 4export default () => { 5 return ( 6 <div> 7 ... 8 <ToastController toastComponent={CustomToastComponent} /> 9 </div> 10 ); 11};
ToastContainer extends properties from ToastContainer in react-toastify. Also have new properties:
Props | Type | Default | Description |
---|---|---|---|
toastComponent | ComponentClass or false | - | Element that will be displayed after emit toast |
Parameter | Type | Required | Description |
---|---|---|---|
toast id | string | ✘ | Id toast for dismiss. If call action without id, then dismiss all toasts |
Parameter | Type | Required | Description |
---|---|---|---|
toast id | string | ✓ | Id toast for update |
options | object | ✘ | Options listed below |
Parameter | Type | Required | Description |
---|---|---|---|
message | string | ✓ | Message for toast |
options | object | ✘ | Options listed below |
Parameter | Type | Default | Description |
---|---|---|---|
renderDefaultComponent | boolean | false | Render default toast component? Use this propery if using custom toast component. |
title | string | '' | Title for custom toast component |
type | One of: 'info', 'success', 'warning', 'error', 'default' | 'default' | same as ToastContainer |
autoClose | number or false | 5000 | Set the delay in ms to close the toast automatically |
hideProgressBar | boolean | false | Hide or show the progress bar |
position | One of: 'top-right', 'top-center', 'top-left', 'bottom-right', 'bottom-center', 'bottom-left' | 'top-right' | Set the default position to use |
pauseOnHover | boolean | true | Pause the timer when the mouse hover the toast |
className | string or object | - | An optional css class to set |
bodyClassName | string or object | - | same as ToastContainer |
progressClassName | string or object | - | same as ToastContainer |
draggable | boolean | true | Allow toast to be draggable |
draggablePercent | number | 80 | The percentage of the toast's width it takes for a drag to dismiss a toast |
Licensed under MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/8 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
107 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn Morecreate-ojk-app
A template for creating new React/TypeScript projects
complete-auth
### Developer: PRAMOD THYAGARAJ
@hutechtechnical/sint-dolor-voluptatibus-quod
[](https://opencollective.com/@hutechtechnical/sint-dolor-voluptatibus-quod) ![React-toastify