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
create-ojk-app
A template for creating new React/TypeScript projects
complete-auth
### Developer: PRAMOD THYAGARAJ
@crabas0npm2/et-quis-blanditiis
[![Financial Contributors on Open Collective](https://opencollective.com/@crabas0npm2/et-quis-blanditiis/all/badge.svg?label=financial+contributors)](https://opencollective.com/@crabas0npm2/et-quis-blanditiis) ![React-toastify CI](https://github.com/craba
@hutechtechnical/sint-dolor-voluptatibus-quod
[![Financial Contributors on Open Collective](https://opencollective.com/@hutechtechnical/sint-dolor-voluptatibus-quod/all/badge.svg?label=financial+contributors)](https://opencollective.com/@hutechtechnical/sint-dolor-voluptatibus-quod) ![React-toastify
npm install react-toastify-redux
Typescript
Module System
Node Version
NPM Version
58.6
Supply Chain
92.9
Quality
75.1
Maintenance
100
Vulnerability
100
License
TypeScript (94.84%)
JavaScript (5.16%)
Total Downloads
144,015
Last Day
3
Last Week
181
Last Month
1,205
Last Year
21,265
22 Stars
12 Commits
7 Forks
3 Watching
2 Branches
2 Contributors
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
-94.6%
3
Compared to previous day
Last week
-38.2%
181
Compared to previous week
Last month
1%
1,205
Compared to previous month
Last year
4.2%
21,265
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
project is not fuzzed
Details
Reason
security policy file not detected
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
102 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-23
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 More