chazzhou / react-alert-template-mui-v5

A react-alert template with material ui

Home Page:https://codesandbox.io/s/react-alert-template-mui-example-up2ys?fontsize=14

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-alert-template-mui

Installation

npm install react-alert-template-mui

Demo

Edit react-alert-template-mui example

How to Use

Simple alert

alert.show("Oh look, an alert!");

Alert with title

alert.show("This is an alert with title!", {
  title: "Random Alert Title",
});

Change copy on close button

alert.show("This is an alert with title!", {
  title: "Random Alert Title",
  closeCopy: "Cancel",
});

Alert with extra actions

alert.show("This is an alert with extra actions!", {
  title: "Alert with extra actions!",
  actions: [
    {
      copy: "Do something",
      onClick: () => setAction("Actioned!"),
    },
  ],
});

About

A react-alert template with material ui

https://codesandbox.io/s/react-alert-template-mui-example-up2ys?fontsize=14

License:MIT License


Languages

Language:TypeScript 100.0%