piral-notifications
Advanced tools
Comparing version 0.10.0-pre.865 to 0.10.0-pre.870
{ | ||
"name": "piral-notifications", | ||
"version": "0.10.0-pre.865", | ||
"version": "0.10.0-pre.870", | ||
"description": "Plugin for triggering notifications in Piral.", | ||
@@ -40,3 +40,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"piral-core": "^0.10.0-pre.865" | ||
"piral-core": "^0.10.0-pre.870" | ||
}, | ||
@@ -46,3 +46,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "8b61ba295ee24b9d5615528dd3e6f300b9186102" | ||
"gitHead": "3f5e9436fc72c2a007c9eaaabca013d0c5288f62" | ||
} |
@@ -80,4 +80,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). |
30581
100