react-push-notification
Advanced tools
Comparing version 1.5.3 to 1.5.4
{ | ||
"name": "react-push-notification", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"description": "React push notifications", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
[![npm version](https://badgen.net/npm/v/react-push-notification)](https://www.npmjs.com/package/react-push-notification) | ||
# Also checkout: React Chat Window + Free Dashboard 🚀 | ||
**Just released my new product! A react Chat window with a free to use tier dashboard. Checkout it out at [https://speak-base.com](https://speak-base.com) or at NPM [@speakbase/react-chat-window](https://www.npmjs.com/package/@speakbase/react-chat-window)** | ||
- React | ||
- Chat window | ||
- Free dashboard | ||
- No-code customization | ||
### Chat window | ||
[<img width="1000" alt="Speak Base" src="https://user-images.githubusercontent.com/36661261/233860682-c0cb6dd0-86ea-4c60-a5df-b8158938c545.png">](https://speak-base.com) | ||
### Free dashboard | ||
[<img width="1000" alt="Screenshot 2023-04-18 at 18 31 59" src="https://user-images.githubusercontent.com/36661261/233898459-84d589b7-b08f-4ddc-9600-3da9f8fb3f23.png">](https://speak-base.com) | ||
**Thank you! ❤️** | ||
--- | ||
# React-push-notification | ||
# react-push-notification | ||
Easy, Type safe & Lightweight push notification library for React.js. | ||
Writtin in TypeScript & compiled to JavaScript for robust code. | ||
Easy, type-safe, & lightweight push notification library for React.js. | ||
Written in TypeScript & compiled to JavaScript for robust code. | ||
In app notification system, as well as web native Notification support. | ||
In-app notification system, as well as web native Notification support. | ||
@@ -45,7 +29,7 @@ ![](https://i.imgur.com/SorfHNa.gif) | ||
In app notification example. Regular React components. | ||
In-app notification example. Regular React components. | ||
![](https://i.imgur.com/SorfHNa.gif) | ||
Web native notification exmaple. Web native components. Send push notifications outside of the browser while the browser is in running in the background or just idle. | ||
Web native notification example. Web native components. Send push notifications outside of the browser while the browser is running in the background or just idle. | ||
@@ -61,4 +45,4 @@ Mac OSX example: | ||
Add the Notifications component to the top of your React.js project. | ||
This is probably index.js or app.js. When using `native: true`, this step is not required. | ||
Add the notifications component to the top of your React.js project. | ||
This is probably `index.js` or `app.js`. When using `native: true`, this step is not required. | ||
@@ -89,3 +73,3 @@ | ||
import the addNotification function and call it. | ||
import the `addNotification` function and call it. | ||
@@ -125,9 +109,9 @@ ```jsx | ||
| ---------------------------------- | ------------------------------------------------------------------ | | ||
| position `string` | One of `top-left`, `top-middle`, `top-right`, `bottom-left`, `bottom-middle`, `bottom-right`. Default: `top-left` | | ||
| position `string` | One of `top-left`, `top-middle`, `top-right`, `bottom-left`, `bottom-middle`, `bottom-right`.<br/>Default: `top-left` | | ||
## addNotification({Options}) argument properties | ||
## `addNotification({Options})` argument properties | ||
The addNaddNotification() function has the following function type: | ||
The `addNotification()` function has the following function type: | ||
@@ -162,3 +146,3 @@ ```tsx | ||
The addNotification() function takes an object as argument with the follow properties: | ||
The `addNotification()` function takes an object as argument with the follow properties: | ||
@@ -171,5 +155,5 @@ | ||
| message `string` | Optional. Message of the push notification | | ||
| onClick `(e: Event OR Notification) => void` | Optional. onClick callback of push notification. When `native: true` e will be of type `Notification`. Else e will be of type `Event`. | | ||
| theme `string` | Optional. One of `darkblue`, `red`, `light`, `undefined`. Default: `undefined` | | ||
| duration `number` | Optional. Duration of the push notification in ms. Default: 3000 | | ||
| onClick `(e: Event OR Notification) => void` | Optional. onClick callback of push notification.<br/>When `native: true` `e` will be of type `Notification`.<br/>Else `e` will be of type `Event`. | | ||
| theme `string` | Optional. One of `darkblue`, `red`, `light`, `undefined`.<br/>Default: `undefined` | | ||
| duration `number` | Optional. Duration of the push notification in ms.<br/>Default: 3000 | | ||
| backgroundTop `string` | Optional. background color of top container. | | ||
@@ -179,4 +163,4 @@ | backgroundBottom `string` | Optional. background color of bottom container. | | ||
| colorBottom `string` | Optional. font color of bottom container. | | ||
| closeButton `string` | Optional. text or html/jsx element for close text. Default: `Close` | | ||
| native `boolean` | Optional. Turns the notification into a native web notification. Default: `false` | | ||
| closeButton `string` | Optional. text or html/jsx element for close text.<br/>Default: `Close` | | ||
| native `boolean` | Optional. Turns the notification into a native web notification. <br/>Default: `false` | | ||
| icon `string` | Optional. Native only. Shows an icon in the notification. | | ||
@@ -194,2 +178,2 @@ | vibrate `number` | `number[]` | Optional. Native only. Makes the notification vibrate. | | ||
Added native os push notification support, as well as an onClick callback function. | ||
Added native OS push notification support, as well as an `onClick` callback function. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36631
172