@croz/nrich-notification-mui
is a MUI wrapper for the @croz/nrich-notification-core module.
For the display of the notifications a Snackbar
and Alert
are used.
To use this module in your project run npm install @croz/nrich-notification-mui
or yarn add @croz/nrich-notification-mui
- Add
Notifications
component on a part of your app, usually onApp
or some other higher level component.
import { Notifications } from "@croz/nrich-notification-mui";
const App = () => {
return (
<div>
<Notifications autoClose={3000} position="top-right"/>
{/* other components... */}
</div>
)
}
Available props for the Notifications
component are:
Prop name | Description | Possible values | Default value |
---|---|---|---|
autoClose | The duration after which the notification closes expressed in milliseconds. If left undefined, it doesn't close. |
number in milliseconds, or undefined |
undefined |
position | Specifies the notification position on the page, derived from a set of predefined positions available in MUI |
top-left , top-center , top-right , bottom-left , bottom-center , bottom-right |
bottom-right |