{"id":18862326,"url":"https://github.com/avrcoelho/react-hook-notification","last_synced_at":"2025-04-14T13:03:02.267Z","repository":{"id":47874735,"uuid":"443803699","full_name":"avrcoelho/react-hook-notification","owner":"avrcoelho","description":"Add notifications in your React app. Types: success, error, warning, info or default","archived":false,"fork":false,"pushed_at":"2022-10-12T23:30:24.000Z","size":1698,"stargazers_count":25,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T02:05:48.605Z","etag":null,"topics":["hook","hooks","javascript","javascript-library","notifications","react","react-hooks","toast","toast-notifications","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-hook-notification","language":"TypeScript","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/avrcoelho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"avrcoelho"}},"created_at":"2022-01-02T15:43:10.000Z","updated_at":"2025-02-19T06:44:08.000Z","dependencies_parsed_at":"2022-09-05T04:00:13.468Z","dependency_job_id":null,"html_url":"https://github.com/avrcoelho/react-hook-notification","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrcoelho%2Freact-hook-notification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrcoelho%2Freact-hook-notification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrcoelho%2Freact-hook-notification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrcoelho%2Freact-hook-notification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avrcoelho","download_url":"https://codeload.github.com/avrcoelho/react-hook-notification/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248684792,"owners_count":21145135,"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":["hook","hooks","javascript","javascript-library","notifications","react","react-hooks","toast","toast-notifications","typescript"],"created_at":"2024-11-08T04:33:59.050Z","updated_at":"2025-04-14T13:03:02.240Z","avatar_url":"https://github.com/avrcoelho.png","language":"TypeScript","funding_links":["https://github.com/sponsors/avrcoelho"],"categories":[],"sub_categories":[],"readme":"# React Hook Notification\n\nAdd notifications in your React app. Types: success, error, warning, info or default\n\n![Demo](demo.png)\n\n## Storybook demo\n\n[https://reverent-lalande-5e2160.netlify.app](https://reverent-lalande-5e2160.netlify.app/?path=/story/notification-example--notificaion)\n\n## Install\n\n```shell\nnpm install react-hook-notification\n```\n\nor\n\n```shell\nyarn add react-hook-notification\n```\n\n## Usage\n\n```js\nimport React from 'react';\nimport { useNotification } from 'react-hook-notification';\n\nexport default function Component() {\n  const notification = useNotification();\n\n  return (\n    \u003cbutton\n      type=\"button\"\n      onClick={() =\u003e\n        notification.success({\n          text: 'Notification test',\n        })\n      }\n    \u003e\n      Dispatch\n    \u003c/button\u003e\n  );\n}\n```\n\n### Props\n\n| Property        | Type                                                                                | Required | Default   | Description                         |\n| --------------- | ----------------------------------------------------------------------------------- | -------- | --------- | ----------------------------------- |\n| text            | string                                                                              | yes      |           | Notification text                   |\n| title           | string                                                                              | no       |           | Notification title                  |\n| position        | top-right \\| top-center \\| top-left \\| bottom-right \\| bottom-center \\| bottom-left | no       | top-right | Notification position               |\n| theme           | colored \\| light \\| dark                                                            | no       | colored   | Notification theme                  |\n| transition      | bounce \\| flip \\| fade \\| slide \\| zoom                                             | no       | bounce    | Notification transition             |\n| delay           | number                                                                              | no       | 5000      | Notification delay in milliseconds  |\n| showProgressBar | boolean                                                                             | no       | true      | Show or hide progress bar           |\n| showButtonClose | boolean                                                                             | no       | true      | Show or hide close button           |\n| closeOnClick    | boolean                                                                             | no       | true      | Close on click                      |\n| showIcon        | boolean                                                                             | no       | true      | Show or hide icon                   |\n| autoClose       | boolean                                                                             | no       | true      | Close notification after delay ends |\n| pauseOnHover    | boolean                                                                             | no       | true      | Auto close pause on hover           |\n| draggable       | boolean                                                                             | no       | true      | Enable or disable drag              |\n| titleMaxLines   | number                                                                              | no       | 1         | Maximum number of lines for title   |\n| textMaxLines    | number                                                                              | no       | 2         | Maximum number of lines for text    |\n\n## LICENSE\n\n[![License](https://img.shields.io/badge/License-MIT-yellow?style=flat\u0026logoColor=f00\u0026link=https://opensource.org/licenses/MIT)](https://opensource.org/licenses/MIT)\n\nDeveloped by: [André Coelho](https://andrecoelho.dev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favrcoelho%2Freact-hook-notification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favrcoelho%2Freact-hook-notification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favrcoelho%2Freact-hook-notification/lists"}