Socket
Book a DemoInstallSign in
Socket

@web-lite/snackbar

Package Overview
Dependencies
Maintainers
6
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web-lite/snackbar

React easy snack-bar

latest
Source
npmnpm
Version
0.0.11
Version published
Maintainers
6
Created
Source

snackbar

downloads

Installation

yarn add react-toastify @web-lite/snackbar

Note

This package has been built on top of followings

    "@material-ui/core": "^4.11.3",
    "@material-ui/icons": "^4.11.2",
    "clsx": "^1.1.1",
    "react": "^16.8.0  || ^17.0.0",
    "react-dom": "^16.8.0  || ^17.0.0"

You may need to install every dependencies which has not been installed yet

🩰 Hopefully it won't need any thing to install

Example

import SnackbarContainer, { sb, globals } from '@web-lite/snackbar'
import '@web-lite/snackbar/style.min.css'

export default function App() {
  const content = {
    title: 'Poison Quotes',
    message:
      'Cheers for everyone who is man, cause everyone who is man, is different from every man.',
    config: {
      position: globals.SNACKBAR_POSITIONS.TOP_CENTER,
      closeOnClick: true,
    },
  }

  return (
    <div className="App">
      <h1>Hello CodeSandbox</h1>
      <h2>Start editing to see some magic happen!</h2>
      <button onClick={sb.success.bind(null, content)}>show success</button>
      <button onClick={sb.info.bind(null, content)}>show info</button>
      <button onClick={sb.warn.bind(null, content)}>show warn</button>
      <button onClick={sb.error.bind(null, content)}>show error</button>
      <SnackbarContainer limit={3} rtl={true} />
    </div>
  )
}

setTimeout(() => sb.success({ title: 'second Title' }), 10000)

FAQs

Package last updated on 02 Jun 2021

Did you know?

Socket

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.

Install

Related posts