You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
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
Package was removed
Sorry, it seems this package was removed from the registry

next-snackbar

It is the snackbar/toast plugin for React.

1.0.5
unpublished
latest
npmnpm
Version published
Maintainers
1
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

reactjs

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