Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

next-snackbar

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-snackbar

It is the snackbar/toast plugin for React.

  • 1.0.5
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

next-snackbar

NPM: npmjs.com/package/next-snackbar

Installation

  • npm i next-snackbar --save

Define Module

import Snackbar from 'next-snackbar';
// or
const Snackbar = require('next-snackbar');

Example JSX Page

// pages/test.jsx

import Snackbar from 'next-snackbar';
const Page = () => {
    const showSnackbar = (id) => {
        new Snackbar({
            options: {
                duration: 3000,
                speed: .5,
                outSpeed: 2.5,
                type: id, //warning, error, info, success
                align: 'end', //start, center, end
                position: 'bottom' // top || bottom
            },
            title: 'Hey?',
            message: '"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'
        }).show()
    }
    return <>
        <button className="btn" onClick={() => showSnackbar('error')}>
            Error Snackbar
        </button>
        <button className="btn" onClick={() => showSnackbar('warning')}>
            Warning Snackbar
        </button>
        <button className="btn" onClick={() => showSnackbar('success')}>
            Success Snackbar
        </button>
        <button className="btn" onClick={() => showSnackbar('info')}>
            Info Snackbar
        </button>
    </>
}

export default Page;

Keywords

FAQs

Package last updated on 25 Dec 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc