mui-react-alert
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

mui-react-alert

An Better way to call mui alert dialog

Installation

Install mui-react-alert with npm

  npm i mui-react-alert

Demo

https://codesandbox.io/s/funny-mestorf-k2dcph

Usage/Examples

App.tsx

import { AlertDialog } from "mui-react-alert";

function App() {
  return (
    <div className="App">
      <AlertDialog />
    </div>
  );
}

export default App;

Button.tsx

import { showAlertConfirmarion } from "mui-react-alert";

function Button() {
  return (
      <button
      onClick={() => {
          showAlertConfirmarion({
          title: "Use Google's location service?",
          cancelLabel: "DISAGREE",
          confirmLabel: "AGREE",
          subtitle:
            "Let Google help apps determine location. This means sending anonymous location data to Google, even when no apps are running.",
          onConfirmation: function (): void {
            alert("Say hello");
          },
        });
      }}
    >
      Show alert dialog
    </button>
  );
}

export default Button;

Contributing

Contributions are always welcome!

Support

For support, email akshayshan28@gmail.com

Package Sidebar

Install

npm i mui-react-alert

Weekly Downloads

254

Version

1.0.7

License

MIT

Unpacked Size

3.06 MB

Total Files

14

Last publish

Collaborators

  • akshays-repo