npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

muinotify

v1.0.6

Published

muinotify has an imperative API that makes it easy to display snackbars, without having to handle their open/close state. It also enables you to stack them on top of one another (although this is discouraged by the Material Design guidelines).

Downloads

12

Readme

muinotify

npm Awesome

Notification System with @MUI Alerts - ReactJs

Muinotify has an imperative API that makes it easy to display snackbars, without having to handle their open/close state. It also enables you to stack them on top of one another (although this is discouraged by the Material Design guidelines).

Installing:

you need to install @MUI first so:

// with npm
npm install @mui/material @emotion/react @emotion/styled

// with yarn
yarn add @mui/material @emotion/react @emotion/styled

and then

npm install muinotify
yarn add muinotify

How to use:

React Component in render method: You Don't have to use options

wrap MuiNotifyProvider over your App.

import React from "react";
import { MuiNotifyProvider } from "muinotify";

class App extends Component {

  render() {
    return (
      <div className="App_Wrapper">
      <MuiNotifyProvider
         maxNotif={4}
        // preventDuplicate
        position="top-right"
        wrapperElement="section"
        wrapperName="amir-rezvani"
        StackProps={{ spacing: 1, direction: "column-reverse" }}
        TransitionProps={{ direction: "left" }}
        generalTimeOut={2000}
        defaultSeverity="error"
        customAlert={(data) => <CustomAlert {...data} />}
      >
        <Application />
      </MuiNotifyProvider>

      </div>
    );
  }
}

export default App;

then use withNotifier or useNotifier to fire up you alert

// with hooks
import React from "react";
import { useNotifier } from "muinotify";

const Application = () => {
const { notifier } = useNotifier();
  return (
    <button
        onClick={() => {
          notifier(`hello world`, {
            isPersist: false,
            variant: "success",
          });
        }}
      >
        Click to show Alert
      </button>
  )
};
// with HOC
import React from "react";
import { withNotifier } from "muinotify";

const Application = ({ notifier }) => {
  return (
    <button
        onClick={() => {
          notifier(`hello world`, {
            isPersist: false,
            variant: "success",
          });
        }}
      >
        Click to show Alert
      </button>
  )
};

export defautl withNotifier(Application);

Available Props:

Default values are into [ ]

| Name | Values | Description | Sample or Support | | ----------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | | maxNotif | [3], 'NUMBER' | maximum number of nofications on the screen | | | position | "bottom-left" , 'STRING' | position of the list of notification on screen | bottom-left, bottom-right, top-left, top-right | | wrapperElement | [div], 'STRING' | the wrapper element of list of notifications (this tag placed outside of application root) | all notification goes inside of this tag | | wrapperName | [rezvani-notify-wrapper], 'STRING' | class name of wrapper tag | pass any string | | TransitionComponent | [Slide], 'COMPONENT' | Slide, Glow, or other transition available in MUI | - | | defaultSeverity | [error], 'STRING' | type of alert- info, warning, error, success | applied on MUI Alert component | | generalTimeOut | [3000], 'NUMBER' | how long it takes to each notification leave the screen | deafult value takes 3 seconed long | | StackProps | [{spacing: 1, direction: "column-reverse"}], 'OBJECT' | All Stack props of MUI stack can be pass through this | children, direction, divider, spacing, etc.. | | AlertProps | [{}], 'OBJECT' | All Alert props of MUI Alert can be pass through this | closeText, iconMapping, severity, variant, etc. | | TransitionProps | [{}], 'OBJECT' | All TRansition props base on selected transition of MUI Transition can be pass through this | choose Fade then have appear, easing, in, timeout, etc. | | customAlert | [], 'FUNCTION' | you can pass any component as an alert | you have access to all options inside of this function render props. | | preventDuplicate | [false], 'BOOL' | prevent duplicate alert messages | just pass this no ignore same alert messages to show |

Author - Contact

Amir Rezvani