{"id":13808633,"url":"https://github.com/anedomansky/ngx-icon","last_synced_at":"2025-10-09T04:25:56.307Z","repository":{"id":213162155,"uuid":"733189862","full_name":"anedomansky/ngx-icon","owner":"anedomansky","description":"An Angular component for displaying SVG icons.","archived":false,"fork":false,"pushed_at":"2024-04-07T13:51:15.000Z","size":653,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-13T11:38:01.133Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anedomansky.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":"2023-12-18T19:06:10.000Z","updated_at":"2024-06-25T02:13:40.000Z","dependencies_parsed_at":"2024-06-19T03:01:44.672Z","dependency_job_id":"01c453b6-1e5c-4f51-b803-03a807193a08","html_url":"https://github.com/anedomansky/ngx-icon","commit_stats":null,"previous_names":["anedomansky/ngx-icon"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anedomansky%2Fngx-icon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anedomansky%2Fngx-icon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anedomansky%2Fngx-icon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anedomansky%2Fngx-icon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anedomansky","download_url":"https://codeload.github.com/anedomansky/ngx-icon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225273251,"owners_count":17448074,"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-04T01:01:47.747Z","updated_at":"2025-10-09T04:25:51.273Z","avatar_url":"https://github.com/anedomansky.png","language":"TypeScript","readme":"# Ngx-icon\n\n[![npm version](https://badge.fury.io/js/@anedomansky%2Fngx-icon.svg)](https://badge.fury.io/js/@anedomansky%2Fngx-icon)\n\nAn Angular component for displaying SVG icons.\n\n## Features\n\n- display any SVG icon\n- add custom CSS to the SVG icons\n- automatic caching of previously added icons\n\n## Dependencies\n\n| ngx-icon | Angular |\n| -------- | ------- |\n| current  | \u003e= 16   |\n\n## Installation\n\n```cli\nnpm install @anedomansky/ngx-icon\n```\n\n## Setup\n\nYou have to add all your icons to the `NgxIconService` in order to display them.\nPlease remove all `height` and `width` attributes from the `\u003csvg\u003e` element beforehand.\nFurthermore, you have to provide the `HttpClient` in your application.\n\n`main.ts`:\n\n```ts\nimport { NgxIconService } from \"@anedomansky/ngx-icon\";\nimport { provideHttpClient } from \"@angular/common/http\";\nimport { APP_INITIALIZER } from \"@angular/core\";\nimport { bootstrapApplication } from \"@angular/platform-browser\";\n\nimport { AppComponent } from \"./app/app.component\";\n\nbootstrapApplication(AppComponent, {\n  providers: [\n    provideHttpClient(),\n    {\n      provide: APP_INITIALIZER,\n      useFactory: (iconService: NgxIconService) =\u003e () =\u003e {\n        iconService.addIcon(\"cart\", \"assets/\");\n        iconService.addIcon(\"camera\", \"assets/\");\n      },\n      deps: [NgxIconService],\n      multi: true,\n    },\n  ],\n});\n```\n\n## Usage\n\n`app.component.html`:\n\n```html\n\u003cdiv class=\"app\"\u003e\n  \u003cngx-icon name=\"cart\"\u003e\u003c/ngx-icon\u003e\n  \u003cngx-icon name=\"camera\"\u003e\u003c/ngx-icon\u003e\n\u003c/div\u003e\n```\n\n`app.component.ts`:\n\n```ts\nimport { NgxIconComponent } from \"@anedomansky/ngx-icon\";\nimport { Component } from \"@angular/core\";\n\n@Component({\n  selector: \"app-root\",\n  templateUrl: \"./app.component.html\",\n  styleUrls: [\"./app.component.scss\"],\n  standalone: true,\n  imports: [NgxIconComponent],\n})\nexport class AppComponent {}\n```\n\n## Customization\n\nYou can alter the appearance (height, width, etc.) of the icons.\n\nAdditionally, there is a CSS Custom Property for the icon's `height` that can easily be updated.\n\n`app.component.scss`:\n\n```scss\n.app ::ng-deep ngx-icon {\n  --ngx-icon-size: 2rem;\n}\n```\n","funding_links":[],"categories":["Table of contents"],"sub_categories":["Third Party Components"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanedomansky%2Fngx-icon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanedomansky%2Fngx-icon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanedomansky%2Fngx-icon/lists"}