@a-faraji/realert-template-mui
v0.0.4
Published
The Material UI based template which can be used by @a-faraji/realert
Downloads
9
Maintainers
Readme
Realert Template: MUI
This is a template to be used with Realert Package.
Installation
npm i @a-faraji/realert-template-mui
yarn add @a-faraji/realert-template-mui
Usage
Pass RealertTemplateMui
as template
prop to RealertProvider
.
import React from 'react';
import { RealertProvider } from '@a-faraji/realert';
import { RealertTemplateMui } from '@a-faraji/realert-template-mui';
export default function App() {
return (
<RealertProvider template={RealertTemplateMui}>
{/* ... rest of your code */}
</RealertProvider>
);
};
To have typescript support for additional dialog props, define the type-aware hook.
import { useRealert, RealertTemplateMuiProps } from '@a-faraji/realert';
const useMuiRealert = useRealert<RealertTemplateMuiProps>;
This new defined hook can be used like this:
// inside a component
const alert = useMuiRealert();
alert.show('This is a MUI alert!')
API
Coming soon!