
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@brancol/react-snackbar
Advanced tools
Snackbar Component developed for React JS.
This project was developed for custom styles. You have a set of props that can change the snackbar appearance, but you may also create your own with the SnackbarProvider render prop.
To install, you can use npm or yarn:
$ npm install @brancol/react-snackbar
$ yarn add @brancol/react-snackbar
To use the snackbar you must place a Context Provider on the top of the project.
import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'
import SnackbarProvider from '@brancol/react-snackbar'
ReactDOM.render(
<SnackbarProvider>
<App />
</SnackbarProvider>,
document.getElementById('root')
)
import React from 'react'
import { useSnackbar } from '@brancol/react-snackbar'
export function App() {
const snackbar = useSnackbar()
return (
<div>
<h1>App</h1>
<div>
<button onClick={() => snackbar.showSuccess('Success Message')}>Show Success</button>
<button onClick={() => snackbar.showWarning('Warning Message')}>Show Warning</button>
<button onClick={() => snackbar.showDanger('Danger Message')}>Show Danger</button>
</div>
</div>
)
}
Want more examples on how to use this snackbar or more use cases for your application?
Checkout my Javascript React Tailwind - Base Project
Or if you using Typescript React Tailwind - Typescript Base Project
Here is a full detailed list of the props you can send to use the SnackbarProvider.
Name | Type | Default | Description | Values |
---|---|---|---|---|
defaultPosition | string | tr | Position of the Snackbar | ['tl', 'tc', 'tr', 'bl', 'bc', 'br'] |
defaultDisplayDuration | number | 5000 | Time that the Snackbar will be displayed | 1000 - 100000 |
defaultAnimationDelay | number | 500 | Time that the Snackbar will take to fadein and fadeout | 100 - 3000 |
successColor | string | '#28c960' | Default success color of the Snackbar | HEX Color |
warningColor | string | '#f49716' | Default warning color of the Snackbar | HEX Color |
dangerColor | string | '#fc5050' | Default danger color of the Snackbar | HEX Color |
showIcon | boolean | true | Indicates if the left icon will be displayed | true - false |
showCloseIcon | boolean | true | Indicates if the close icon will be displayed | true - false |
render | (props) => Node | null | A custom Snackbar component with all props | ReactNode |
When calling the useSnackbar open methos, you can send a list of options for that specific open.
Name | Type | Description | Values |
---|---|---|---|
duration | number | Time that the Snackbar will be displayed | 1000 - 100000 |
animationDelay | number | Time that the Snackbar will take to fadein and fadeout | 100 - 3000 |
position | string | Position of the Snackbar | ['tl', 'tc', 'tr', 'bl', 'bc', 'br'] |
displayIcon | boolean | Indicates if the left icon will be displayed | true - false |
displayCloseIcon | boolean | Indicates if the close icon will be displayed | true - false |
This snackbar component is already tested using Jest and Enzyme. You may create your own tests using this modules as well.
You can find other projects and more stuff in my:
Github Profile
Personal Website
Instagram Profile
FAQs
Brancol - React Snackbar
The npm package @brancol/react-snackbar receives a total of 3 weekly downloads. As such, @brancol/react-snackbar popularity was classified as not popular.
We found that @brancol/react-snackbar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.