Simple notification component for React with support for Typescript!
- Use npm
npm install noti-react
- Use yarn
yarn add noti-react
property | propType | required | default | description |
---|---|---|---|---|
type | string ('error', 'info', 'success', 'warn') | - | 'info' | Deside which type of notification do you want to use! |
label | string | yes | - | Text which you want to display |
autoHide | bool | - | true | Auto hide notification |
animationTime | number | - | 500 | Time of animation duration in miliseconds |
position | string ('top-left', 'top-right', 'bottom-left', 'bottom-right') | - | 'bottom-right' | Position in which corner do you want to display notification |
hideTime | number | - | 5000 | After this time notification will close if autoHide props is true |
customColor | string (rgb string like '#000000') | - | - | Add your custom color |
className | string | - | - | Customize style by adding custom class |
- Import notification component
import { Notification } from 'noti-react';
- Use it in your component
<Notification
label="Example of notification"
/>
Run tests
npm test