{"id":13755480,"url":"https://github.com/trendmicro-frontend/react-notifications","last_synced_at":"2025-09-04T14:32:30.083Z","repository":{"id":57167638,"uuid":"94797725","full_name":"trendmicro-frontend/react-notifications","owner":"trendmicro-frontend","description":"React Notifications component","archived":false,"fork":false,"pushed_at":"2023-09-22T14:07:07.000Z","size":2477,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-12-10T01:13:05.707Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://trendmicro-frontend.github.io/react-notifications","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/trendmicro-frontend.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-19T16:28:42.000Z","updated_at":"2023-09-22T14:06:57.000Z","dependencies_parsed_at":"2024-08-03T20:46:58.834Z","dependency_job_id":null,"html_url":"https://github.com/trendmicro-frontend/react-notifications","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro-frontend%2Freact-notifications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro-frontend%2Freact-notifications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro-frontend%2Freact-notifications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro-frontend%2Freact-notifications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trendmicro-frontend","download_url":"https://codeload.github.com/trendmicro-frontend/react-notifications/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231970098,"owners_count":18453911,"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":[],"created_at":"2024-08-03T10:00:54.967Z","updated_at":"2024-12-31T09:32:50.080Z","avatar_url":"https://github.com/trendmicro-frontend.png","language":"JavaScript","funding_links":[],"categories":["Trend Micro"],"sub_categories":["React Components"],"readme":"# react-notifications [![build status](https://travis-ci.org/trendmicro-frontend/react-notifications.svg?branch=master)](https://travis-ci.org/trendmicro-frontend/react-notifications) [![Coverage Status](https://coveralls.io/repos/github/trendmicro-frontend/react-notifications/badge.svg?branch=master)](https://coveralls.io/github/trendmicro-frontend/react-notifications?branch=master)\n\n[![NPM](https://nodei.co/npm/@trendmicro/react-notifications.png?downloads=true\u0026stars=true)](https://nodei.co/npm/@trendmicro/react-notifications/)\n\nReact Notifications\n\nDemo: https://trendmicro-frontend.github.io/react-notifications\n\n## Installation\n\n1. Install the latest version of [react](https://github.com/facebook/react) and [react-notifications](https://github.com/trendmicro-frontend/react-notifications):\n\n  ```\n  npm install --save react @trendmicro/react-notifications\n  ```\n\n2. At this point you can import `@trendmicro/react-notifications` and its styles in your application as follows:\n\n  ```js\n  import { Notification, ToastNotification } from '@trendmicro/react-notifications';\n\n  // Be sure to include styles at some point, probably during your bootstraping\n  import '@trendmicro/react-notifications/dist/react-notifications.css';\n  ```\n\n## Usage\n\n### Notification\n\n#### Controlled Notification\n\n```js\nconst { dismissed } = this.state;\n\n\u003cNotification\n    show={!dismissed}\n    type=\"error\"\n    onDismiss={event =\u003e {\n        this.setState({ dismissed: true });\n    }}\n/\u003e\n```\n\n#### Uncontrolled Notification\n\nNote: Always pass a new key while re-rendering uncontrolled notifications.\n\n```js\n\u003cNotification\n    key={_.uniqueId()}\n    type=\"error\"\n    onDismiss={event =\u003e { // Optional\n        // Generate a new key if the notification is dismissed.\n    }}\n/\u003e\n```\n\n### Toast Notification\n\n#### Controlled Toast Notification\n\n```js\nconst { dismissed } = this.state;\n\n\u003cToastNotification\n    show={!dismissed}\n    type=\"warning\"\n    autoDismiss={5000}\n    onDismiss={event =\u003e {\n        this.setState({ dismissed: true });\n    }}\n/\u003e\n```\n\n#### Uncontrolled Toast Notification\n\nNote: Always pass a new key while re-rendering uncontrolled toast notifications.\n\n```js\n\u003cToastNotification\n    key={_.uniqueId()}\n    type=\"warning\"\n    autoDismiss={5000}\n    onDismiss={event =\u003e { // Optional\n        // Generate a new key if the toast notification is dismissed.\n    }}\n/\u003e\n```\n\n## API\n\n### Properties\n\nName        | Type     | Default | Description \n:---------- | :--------| :------ | :----------\ntype        | String   | ''      | One of: 'error', 'warning', 'info', 'success'\nshow        | Boolean  | true    | Whether or not the component is visible.\ndismissible | Boolean  | true    | Whether or not the notification is dismissible.\nautoDismiss | Number or Boolean  | false | The auto dismiss timeout in milliseconds.\nonDismiss   | Function |         | A callback fired when the dismiss icon (x) is clicked.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrendmicro-frontend%2Freact-notifications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrendmicro-frontend%2Freact-notifications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrendmicro-frontend%2Freact-notifications/lists"}