piral-notifications
Advanced tools
Comparing version 0.9.7 to 0.9.8
{ | ||
"name": "piral-notifications", | ||
"version": "0.9.7", | ||
"version": "0.9.8", | ||
"description": "Plugin for triggering notifications in Piral.", | ||
@@ -41,3 +41,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"piral-core": "^0.9.7" | ||
"piral-core": "^0.9.8" | ||
}, | ||
@@ -47,3 +47,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "c4d1a6be5e020e5031fdf43392a48c341540104b" | ||
"gitHead": "0dba7e38487b43dbd350fb623f51c4449030e1ba" | ||
} |
@@ -60,4 +60,21 @@ [![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io) | ||
In order to host the toast notifications you'll need to embed the `Notifications` component somewhere in your layout. | ||
As an example: | ||
```jsx | ||
import { Notifications } from 'piral-notifications'; | ||
const MyLayout = ({ children }) => { | ||
<div> | ||
<Notifications /> | ||
{children} | ||
</div> | ||
}; | ||
``` | ||
If you want to customize the styling (which you should) make sure to register components such as `NotificationsHost` (shell for the notifications) or `NotificationsToast` (wrapper for an individual notification) via, e.g., `<SetComponent name="NotificationsHost" component={MyNotificationsHost} />`. | ||
## License | ||
Piral is released using the MIT license. For more information see the [license file](./LICENSE). |
30255
80