{"id":27880522,"url":"https://github.com/nhusby/ng-toast-service","last_synced_at":"2025-05-05T04:03:13.566Z","repository":{"id":288720491,"uuid":"968928677","full_name":"nhusby/ng-toast-service","owner":"nhusby","description":"Simple customizable Angular toast notification service","archived":false,"fork":false,"pushed_at":"2025-04-19T07:50:37.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T13:46:13.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nhusby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-04-19T02:23:21.000Z","updated_at":"2025-04-19T07:50:40.000Z","dependencies_parsed_at":"2025-04-19T13:46:18.436Z","dependency_job_id":"1be36cc0-cee4-4800-84ea-d987c865937d","html_url":"https://github.com/nhusby/ng-toast-service","commit_stats":null,"previous_names":["nhusby/ng-toaster"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhusby%2Fng-toast-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhusby%2Fng-toast-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhusby%2Fng-toast-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhusby%2Fng-toast-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nhusby","download_url":"https://codeload.github.com/nhusby/ng-toast-service/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252436291,"owners_count":21747470,"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":"2025-05-05T04:02:23.361Z","updated_at":"2025-05-05T04:03:13.557Z","avatar_url":"https://github.com/nhusby.png","language":"TypeScript","funding_links":[],"categories":["Recently Updated","Third Party Components"],"sub_categories":["[May 05, 2025](/content/2025/05/05/README.md)","Notifications"],"readme":"# ng-toast-service\n\nA simple, customizable notification service for Angular applications. This service shows notifications that slide onto the screen with configurable behavior.\n\n## Features\n\n- Show notifications that slide onto the screen\n- Configurable position and timeout\n- Stack multiple notifications with offset\n- Close button for each notification\n- Support for text notifications\n\n## Installation\n\n```bash\nnpm install ng-toast-service\n```\n\n## Usage\n\n### Import the service\n\n```typescript\nimport { ToasterService } from 'ng-toast-service';\n\n@Component({\n  // ...\n})\nexport class YourComponent {\n  constructor(private toasterService: ToasterService) {}\n}\n```\n\n### Show a simple text notification\n\n```typescript\nthis.toasterService.toast('This is a notification message');\n```\n\n### Customize notification behavior\n\n```typescript\nthis.toasterService.toast('This is a notification message', {\n  position: 'top-right',       // 'top', 'top-left', 'top-right', 'bottom-left', 'bottom-right', 'bottom'\n  timeout: 5000,               // Time in milliseconds before auto-close (0 to disable)\n  showCloseButton: true        // Whether to show a close button\n});\n```\n\n### Show a notification with a component\n\n```typescript\nimport { YourNotificationComponent } from './your-notification.component';\n\n// In your component\nconst notification = this.toasterService.toast(YourNotificationComponent, {\n  // Optional bindings for your component\n  message: 'Hello World',\n  type: 'success'\n}, {\n  showCloseButton: false\n});\n\n// You can now use the returned component instance\nconsole.log(notification.message); // Outputs: \"Hello World\"\n```\n\n### Close notifications\n\n```typescript\n// Close a specific notification\nconst notification = this.toasterService.toast('This will be closed');\nthis.toasterService.close(notification);\n\n// Close all notifications\nthis.toasterService.closeAll();\n```\n\n## Configuration\n\nThe default configuration is:\n\n```typescript\nconst defaultConfig = {\n  position: 'bottom-right',\n  timeout: 5000,\n  showCloseButton: true\n};\n```\n\n## Styling\n\nThe package includes default styling in `toaster.service.css`, but you can override it by targeting the following CSS classes:\n\n- `.toast-host`: The container for all notifications\n- `.toast-notification`: The notification element\n- `.toast-content`: The content container\n- `.toast-text`: Text content\n- `.toast-close`: Close button\n\nPosition classes:\n- `.toast-top-left`\n- `.toast-top-right`\n- `.toast-bottom-left`\n- `.toast-bottom-right`\n\nAnimation classes:\n- `.toast-slide-from-top`\n- `.toast-slide-from-bottom`\n- `.toast-closing`\n\n## Building\n\nTo build the library, run:\n\n```bash\nng build ng-toast-service\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhusby%2Fng-toast-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnhusby%2Fng-toast-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhusby%2Fng-toast-service/lists"}