{"id":23333483,"url":"https://github.com/creativetimofficial/react-notification-alert","last_synced_at":"2025-04-09T18:24:00.351Z","repository":{"id":55867842,"uuid":"111791260","full_name":"creativetimofficial/react-notification-alert","owner":"creativetimofficial","description":"React bootstrap 4 notification alert","archived":false,"fork":false,"pushed_at":"2020-12-10T14:22:46.000Z","size":51,"stargazers_count":37,"open_issues_count":2,"forks_count":21,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-05T02:02:43.990Z","etag":null,"topics":["bootstrap4","component","notification","nowuidashboard","react","react-alert","react-component","react-notifications","reactjs","reactstrap","responsive","webdesgin"],"latest_commit_sha":null,"homepage":"https://www.creative-tim.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/creativetimofficial.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-23T09:44:32.000Z","updated_at":"2023-12-12T16:43:24.000Z","dependencies_parsed_at":"2022-08-15T08:10:22.237Z","dependency_job_id":null,"html_url":"https://github.com/creativetimofficial/react-notification-alert","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativetimofficial%2Freact-notification-alert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativetimofficial%2Freact-notification-alert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativetimofficial%2Freact-notification-alert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativetimofficial%2Freact-notification-alert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creativetimofficial","download_url":"https://codeload.github.com/creativetimofficial/react-notification-alert/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248086179,"owners_count":21045291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap4","component","notification","nowuidashboard","react","react-alert","react-component","react-notifications","reactjs","reactstrap","responsive","webdesgin"],"created_at":"2024-12-21T00:17:25.434Z","updated_at":"2025-04-09T18:24:00.328Z","avatar_url":"https://github.com/creativetimofficial.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Notification Alert\n[![version][version-badge]][CHANGELOG] [![license][license-badge]][LICENSE]\n\n**React Notification Alert** is a component made with [reactstrap components](https://reactstrap.github.io/) and [React](https://reactjs.org/).\n\n## Installation\n\n`npm install --save react-notification-alert`\n\n## Usage\nYou can import react-notification-alert in your application like so:\n\n`import NotificationAlert from 'react-notification-alert';`\n\nAfter that, in your component render method add the following line:\n\n`\u003cNotificationAlert ref=\"notificationAlert\" zIndex={1031} onClick={() =\u003e console.log(\"hey\")} /\u003e`\n\nWe've used `ref=\"notificationAlert\"` property on the `NotificationAlert` tag to access this components properties.\n\nSomewhere in your component call `notificationAlert(options)` function like:\n\n`this.refs.notificationAlert.notificationAlert(options);`\n\n## Styles\n\nDo not forget to import our styles in your project:\n```\nimport \"react-notification-alert/dist/animate.css\";\n```\n\n## *zIndex*\nIf you want to add a special zIndex to the notification, if not, `9999` will be set as default.\n\n## *onClick*\nThis function will be called when the user clicks on a certain notification.\n\n## *options* parameter\n\nThis parameter has to be a javascript object with the following props:\n\n```\nvar options = {\n    place: ,\n    message: ,\n    type: ,\n    icon: ,\n    autoDismiss: ,\n    closeButton: ,\n    zIndex: ,\n}\n```\n\n### *place*\nThis is where will the notification appear. Can be one of:\n1. `tl` - notification will be rendered in the top-left corner of the screen\n2. `tc` - notification will be rendered in the top-center corner of the screen\n3. `tr` - notification will be rendered in the top-right corner of the screen\n4. `bl` - notification will be rendered in the bottom-left corner of the screen\n5. `bc` - notification will be rendered in the bottom-center corner of the screen\n6. `br` - notification will be rendered in the bottom-right corner of the screen\n\n### *message*\nCan be `string` / `node`. This is goind to be the message inside the `notification`.\n\n### *type*\nThis is the color of the notification and can be one of, according to [reactstrap colors for alerts](https://reactstrap.github.io/components/alerts/):\n1. `primary`\n2. `secondary`\n3. `success`\n4. `danger`\n5. `warning`\n6. `info`\n7. `light`\n8. `dark`\n\n### *icon*\nString used to add an icon to the notification.\n\n### *autoDismiss*\nThis prop is used to tell the notification after how many **seconds** to auto close.\nIf is set to a value lower than or equal to 0, then the notification will not auto close.\n\n### *closeButton*\nIf this prop is set to false, than no close button will render in the notification.\n\n## Example code\n\n```\nimport React, { Component } from 'react';\nimport NotificationAlert from 'react-notification-alert';\n\nvar options = {};\noptions = {\n    place: 'tl',\n    message: (\n        \u003cdiv\u003e\n            \u003cdiv\u003e\n                Welcome to \u003cb\u003eNow UI Dashboard React\u003c/b\u003e - a beautiful freebie for every web developer.\n            \u003c/div\u003e\n        \u003c/div\u003e\n    ),\n    type: \"danger\",\n    icon: \"now-ui-icons ui-1_bell-53\",\n    autoDismiss: 7\n}\n\nclass App extends Component {\n    myFunc(){\n        this.refs.notify.notificationAlert(options);\n    }\n  render() {\n    return (\n      \u003cdiv\u003e\n          \u003cNotificationAlert ref=\"notify\" zIndex={9999} onClick={() =\u003e console.log(\"hey\")} /\u003e\n        \u003cbutton onClick={() =\u003e this.myFunc()}\u003eHey\u003c/button\u003e\n      \u003c/div\u003e\n    );\n  }\n}\n\nexport default App;\n```\n\n## Dependencies\n\nFor this component to work properly you have to have the following libraries installed in your project:\n\n```\nnpm install --save reactstrap\nnpm install --save bootstrap\n```\nBootstrap will require the following:\n```\nnpm install --save jquery\n```\n\n\n[CHANGELOG]: ./CHANGELOG.md\n\n[LICENSE]: ./LICENSE.md\n[version-badge]: https://img.shields.io/badge/version-0.0.13-blue.svg\n[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreativetimofficial%2Freact-notification-alert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreativetimofficial%2Freact-notification-alert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreativetimofficial%2Freact-notification-alert/lists"}