@ng-icons/ionicons 27.1.0 → 27.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
<img width="600" alt="logo" src="https://github.com/ng-icons/ng-icons/assets/20795331/8781b0a9-2c8a-4a7f-9afd-13e47d14cffe">
|
|
2
2
|
|
|
3
|
+
<div style="margin-top: 1rem;">
|
|
4
|
+
<img alt="NPM Downloads" src="https://img.shields.io/npm/dt/%40ng-icons%2Fcore">
|
|
5
|
+
<img alt="NPM Version" src="https://img.shields.io/npm/v/%40ng-icons%2Fcore">
|
|
6
|
+
<img alt="GitHub Sponsors" src="https://img.shields.io/github/sponsors/ashley-hunter">
|
|
7
|
+
</div>
|
|
8
|
+
|
|
3
9
|
# Ng Icons
|
|
4
10
|
|
|
5
11
|
The all-in-one icon library for Angular. This allows you to use icons from multiple icon sets with a single icon component.
|
|
6
|
-
Containing over
|
|
12
|
+
Containing over 38,900 icons for you to use in your projects.
|
|
7
13
|
|
|
8
14
|
Currently, we support the following libraries:
|
|
9
15
|
|
|
@@ -29,9 +35,16 @@ Currently, we support the following libraries:
|
|
|
29
35
|
- [Remix Icon](https://remixicon.com/)
|
|
30
36
|
- [Font Awesome](https://fontawesome.com/)
|
|
31
37
|
- [Iconsax](https://iconsax.io/)
|
|
38
|
+
- [TDesign Icons](https://github.com/Tencent/tdesign-icons)
|
|
32
39
|
|
|
33
40
|
Got suggestions for additional iconsets? Create an issue and we can consider adding them!
|
|
34
41
|
|
|
42
|
+
## Supporting Ng Icons
|
|
43
|
+
|
|
44
|
+
Ng Icons is an MIT-licensed open source project with its ongoing development made possible by contributors and sponsors.
|
|
45
|
+
|
|
46
|
+
[Become a Sponsor!](https://github.com/sponsors/ashley-hunter).
|
|
47
|
+
|
|
35
48
|
## Supported Versions
|
|
36
49
|
|
|
37
50
|
| Angular Version | Ng Icon Version |
|
|
@@ -91,6 +104,7 @@ The following packages are available:
|
|
|
91
104
|
| `@ng-icons/remixicon` | Apache 2.0 |
|
|
92
105
|
| `@ng-icons/font-awesome` | CC BY 4.0 |
|
|
93
106
|
| `@ng-icons/iconsax` | [Custom](https://iconsax.io/#license) |
|
|
107
|
+
| `@ng-icons/tdesign-icons` | MIT |
|
|
94
108
|
|
|
95
109
|
## Usage
|
|
96
110
|
|
|
@@ -220,6 +234,21 @@ bootstrapApplication(AppComponent, {
|
|
|
220
234
|
});
|
|
221
235
|
```
|
|
222
236
|
|
|
237
|
+
### Logging
|
|
238
|
+
|
|
239
|
+
By default Ng Icons will log warnings or errors to the console - notably if you try to use an icon that has not been registered.
|
|
240
|
+
Should you want stricter checks you can enable the `ExceptionLogger` which will throw an error if you try to use an icon that has not been registered.
|
|
241
|
+
|
|
242
|
+
You can enable this by providing the `withExceptionLogger` function to the `provideNgIconsConfig` function.
|
|
243
|
+
|
|
244
|
+
```ts
|
|
245
|
+
import { NgIconComponent, provideIcons, provideNgIconsConfig, withExceptionLogger } from '@ng-icons/core';
|
|
246
|
+
|
|
247
|
+
bootstrapApplication(AppComponent, {
|
|
248
|
+
providers: [provideNgIconsConfig({}, withExceptionLogger())],
|
|
249
|
+
});
|
|
250
|
+
```
|
|
251
|
+
|
|
223
252
|
### Dynamically Loading Icons
|
|
224
253
|
|
|
225
254
|
The most common way to load icons is simply by registering them individually, however you may want to load icons lazily from a URL, or generate an SVG programatically on the fly. This can be achived using an icon loader. Icon loaders are a function that receives the name of the requested icon, and can return an `Observable<string>`, `Promise<string>` or a `string` containing the SVG to render. Within this function you can do whatever you need to retrieve an icon.
|