Gathering detailed insights and metrics for @scrumble-nl/quick-toaster
Gathering detailed insights and metrics for @scrumble-nl/quick-toaster
Gathering detailed insights and metrics for @scrumble-nl/quick-toaster
Gathering detailed insights and metrics for @scrumble-nl/quick-toaster
A quick and easy wrapper around react-bootstrap toasters, you can toast from anywhere in your application with a few simple steps.
npm install @scrumble-nl/quick-toaster
Typescript
Module System
Node Version
NPM Version
TypeScript (78%)
JavaScript (16.32%)
SCSS (5.68%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
6 Stars
68 Commits
3 Forks
6 Branches
5 Contributors
Updated on May 13, 2025
Latest Version
0.1.6
Package Id
@scrumble-nl/quick-toaster@0.1.6
Unpacked Size
16.16 kB
Size
4.70 kB
File Count
13
NPM Version
6.9.0
Node Version
10.16.3
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A quick and easy wrapper around react-bootstrap toasters, you can toast from anywhere in your application with a few simple steps.
1npm install @scrumble-nl/quick-toaster
or
1yarn add @scrumble-nl/quick-toaster
Add the provider as top level as possible:
1import React from 'react'; 2import App from './src/app'; 3import {ToastProvider} from '@scrumble-nl/quick-toaster'; // Don't forget to import this 4 5export default class ToastApp extends React.Component<{}, {}> { 6 render = (): JSX.Element => { 7 return ( 8 <ToastProvider> 9 <App/> 10 </ToastProvider> 11 ) 12 } 13}
The ToastProvider
has multiple optional props so you can customize it to your needs:
Name | Type | Required | Description | Default |
---|---|---|---|---|
position | 'top-left', 'top-right', 'bottom-left', 'bottom-right' | false | The position of the toast container | top-right |
maxItems | number | false | The maximum amount of toasts rendered at a given time | 8 |
defaultTimer | number | false | The default amount of ms before the toast is removed | 4000 |
withToaster
in the component where you want to create a toastIToast
and add toaster to your interfaceexport default withToaster(MyComponent)
to the file1import React from 'react'; 2import {withToaster, IToast} from '@scrumble-nl/quick-toaster'; // Step 1 (& 2) 3 4interface props { 5 toaster: { 6 add(toast: IToast): void, // Step 2 7 }, 8} 9 10class MyComponent extends React.Component<props, {}> { 11 12 showToast = (): void => { 13 this.props.toaster.add({content: 'Damn, this is an easy package!'}); // Step 4 14 } 15 16 render = (): JSX.Element => { 17 return ( 18 <button onClick={this.showToast}>Show my awesome toast</button> 19 ) 20 } 21} 22 23export default withToaster(MyComponent); // Step 3
The following options can be used for customization:
Name | Type | Required | Description | Default |
---|---|---|---|---|
content | string | true | The content for the toast | undefined |
header | string | false | The header for the toast | '' |
variant | 'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light' | false | The toast type | success |
dismissTimer | number | false | Auto dismiss amount in milliseconds | dismissTimer of ToastProvider |
dismissible | boolean | false | If you can dismiss the toast | true |
Next to that you can override the bootstrap class .alert
to change the look of the toasts.
If you would like to see additions/changes to this package you are always welcome to add some code or improve it.
This product has been originally developed by Scrumble for internal use. As we have been using lots of open source packages we wanted to give back to the community. We hope this helps you getting forward as much as other people helped us!
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
1 existing vulnerabilities detected
Details
Reason
10 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 8
Reason
Found 4/8 approved changesets -- score normalized to 5
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
license file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
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