Skip to content

A simple yet beautiful Snackbar popup component for React.

License

Notifications You must be signed in to change notification settings

nagibmahfuj/snackbar-react

Repository files navigation

A simple yet beautiful Snackbar popup component for React.

Install

Install using npm install snackbar-react

Usage

In a React app, use the Snackbar component:
import { Snackbar, showSnackbar } from 'snackbar-react'

<Snackbar
    open={true}
    type="success"
    message="Your username/password is not valid."
    autoHide={false}
/>

Or use as a function showSnackbar():

showSnackbar({
    open: true,
    type: "success",
    message: "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
    autoHide: false,
});

Snackbar props

Name Type Default Description
open Boolean true true or false
type string null 'info' or 'success' or 'error'
message string ''
handleClose function null
autoHide Boolean true true or false
autoHideDuration integer 5000 value in ms

About

A simple yet beautiful Snackbar popup component for React.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published