@ng-icons/iconsax 26.4.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 +264 -0
- package/bold/README.md +3 -0
- package/bold/index.d.ts +896 -0
- package/bulk/README.md +3 -0
- package/bulk/index.d.ts +895 -0
- package/esm2022/bold/index.mjs +897 -0
- package/esm2022/bold/ng-icons-iconsax-bold.mjs +5 -0
- package/esm2022/bulk/index.mjs +896 -0
- package/esm2022/bulk/ng-icons-iconsax-bulk.mjs +5 -0
- package/esm2022/index.mjs +3 -0
- package/esm2022/ng-icons-iconsax.mjs +5 -0
- package/esm2022/outline/index.mjs +897 -0
- package/esm2022/outline/ng-icons-iconsax-outline.mjs +5 -0
- package/fesm2022/ng-icons-iconsax-bold.mjs +903 -0
- package/fesm2022/ng-icons-iconsax-bold.mjs.map +1 -0
- package/fesm2022/ng-icons-iconsax-bulk.mjs +902 -0
- package/fesm2022/ng-icons-iconsax-bulk.mjs.map +1 -0
- package/fesm2022/ng-icons-iconsax-outline.mjs +903 -0
- package/fesm2022/ng-icons-iconsax-outline.mjs.map +1 -0
- package/fesm2022/ng-icons-iconsax.mjs +7 -0
- package/fesm2022/ng-icons-iconsax.mjs.map +1 -0
- package/index.d.ts +2 -0
- package/outline/README.md +3 -0
- package/outline/index.d.ts +896 -0
- package/package.json +45 -0
package/README.md
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
<img width="600" alt="logo" src="https://github.com/ng-icons/ng-icons/assets/20795331/8781b0a9-2c8a-4a7f-9afd-13e47d14cffe">
|
|
2
|
+
|
|
3
|
+
# Ng Icons
|
|
4
|
+
|
|
5
|
+
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 35,500 icons for you to use in your projects.
|
|
7
|
+
|
|
8
|
+
Currently, we support the following libraries:
|
|
9
|
+
|
|
10
|
+
- [Bootstrap Icons](https://icons.getbootstrap.com/)
|
|
11
|
+
- [Heroicons](https://heroicons.com/)
|
|
12
|
+
- [Ionicons](https://ionic.io/ionicons)
|
|
13
|
+
- [Material Icons](https://fonts.google.com/icons?selected=Material+Icons)
|
|
14
|
+
- [Material File Icons](https://github.com/PKief/vscode-material-icon-theme)
|
|
15
|
+
- [CSS.gg](https://css.gg/)
|
|
16
|
+
- [Feather Icons](https://feathericons.com/)
|
|
17
|
+
- [Jam Icons](https://jam-icons.com/)
|
|
18
|
+
- [Octicons](https://github.com/primer/octicons)
|
|
19
|
+
- [Radix UI Icons](https://icons.modulz.app/)
|
|
20
|
+
- [Tabler Icons](https://tabler-icons.io/)
|
|
21
|
+
- [Akar Icons](https://akaricons.com/)
|
|
22
|
+
- [Iconoir](https://iconoir.com/)
|
|
23
|
+
- [Cryptocurrency Icons](http://cryptoicons.co/)
|
|
24
|
+
- [Simple Icons](https://simpleicons.org/)
|
|
25
|
+
- [Typicons](https://www.s-ings.com/typicons/)
|
|
26
|
+
- [Dripicons](https://github.com/amitjakhu/dripicons)
|
|
27
|
+
- [UX Aspects](https://uxaspects.github.io/UXAspects/)
|
|
28
|
+
- [Circum Icons](https://circumicons.com/)
|
|
29
|
+
- [Remix Icon](https://remixicon.com/)
|
|
30
|
+
- [Font Awesome](https://fontawesome.com/)
|
|
31
|
+
- [Iconsax](https://iconsax.io/)
|
|
32
|
+
|
|
33
|
+
Got suggestions for additional iconsets? Create an issue and we can consider adding them!
|
|
34
|
+
|
|
35
|
+
## Supported Versions
|
|
36
|
+
|
|
37
|
+
| Angular Version | Ng Icon Version |
|
|
38
|
+
| --------------- | --------------- |
|
|
39
|
+
| 11.x.x | 12.x.x |
|
|
40
|
+
| 12.x.x | 12.x.x - 13.x.x |
|
|
41
|
+
| 13.x.x | 13.x.x - 17.x.x |
|
|
42
|
+
| 14.x.x | 17.x.x - 22.x.x |
|
|
43
|
+
| 15.x.x | 23.x.x - 24.x.x |
|
|
44
|
+
| 16.x.x | 25.x.x |
|
|
45
|
+
| 17.x.x | 26.x.x |
|
|
46
|
+
|
|
47
|
+
> **Note**: Ng Icons relies on modern browser features and is designed to work on evergreen browsers. We do not support older browsers such as IE11.
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
You must install the `@ng-icons/core` package, however you only need to install the iconset libraries you intend to use.
|
|
52
|
+
|
|
53
|
+
E.g:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm i @ng-icons/core @ng-icons/heroicons ...
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
or
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
yarn add @ng-icons/core @ng-icons/heroicons ...
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Packages
|
|
66
|
+
|
|
67
|
+
The following packages are available:
|
|
68
|
+
|
|
69
|
+
| Package | License |
|
|
70
|
+
| -------------------------------- | ------------------------------------- |
|
|
71
|
+
| `@ng-icons/core` | MIT |
|
|
72
|
+
| `@ng-icons/bootstrap-icons` | MIT |
|
|
73
|
+
| `@ng-icons/heroicons` | MIT |
|
|
74
|
+
| `@ng-icons/ionicons` | MIT |
|
|
75
|
+
| `@ng-icons/material-icons` | Apache 2.0 |
|
|
76
|
+
| `@ng-icons/material-file-icons` | MIT |
|
|
77
|
+
| `@ng-icons/css.gg` | MIT |
|
|
78
|
+
| `@ng-icons/feather-icons` | MIT |
|
|
79
|
+
| `@ng-icons/jam-icons` | MIT |
|
|
80
|
+
| `@ng-icons/octicons` | MIT |
|
|
81
|
+
| `@ng-icons/radix-icons` | MIT |
|
|
82
|
+
| `@ng-icons/tabler-icons` | MIT |
|
|
83
|
+
| `@ng-icons/akar-icons` | MIT |
|
|
84
|
+
| `@ng-icons/iconoir` | MIT |
|
|
85
|
+
| `@ng-icons/cryptocurrency-icons` | CC0-1.0 |
|
|
86
|
+
| `@ng-icons/simple-icons` | CC0-1.0 |
|
|
87
|
+
| `@ng-icons/typicons` | CC-BY-SA-4.0 |
|
|
88
|
+
| `@ng-icons/dripicons` | CC-BY-SA-4.0 |
|
|
89
|
+
| `@ng-icons/ux-aspects` | Apache 2.0 |
|
|
90
|
+
| `@ng-icons/circum-icons` | MPL-2.0 |
|
|
91
|
+
| `@ng-icons/remixicon` | Apache 2.0 |
|
|
92
|
+
| `@ng-icons/font-awesome` | CC BY 4.0 |
|
|
93
|
+
| `@ng-icons/iconsax` | [Custom](https://iconsax.io/#license) |
|
|
94
|
+
|
|
95
|
+
## Usage
|
|
96
|
+
|
|
97
|
+
Import the `NgIconsModule` and register the icons you wish to use:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
import { NgIconsModule } from '@ng-icons/core';
|
|
101
|
+
import { featherAirplay } from '@ng-icons/feather-icons';
|
|
102
|
+
import { heroUsers } from '@ng-icons/heroicons/outline';
|
|
103
|
+
|
|
104
|
+
@NgModule({
|
|
105
|
+
imports: [BrowserModule, NgIconsModule.withIcons({ featherAirplay, heroUsers })],
|
|
106
|
+
})
|
|
107
|
+
export class AppModule {}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
You can register icons in multiple modules, this allows icons to be lazy loaded in child modules.
|
|
111
|
+
|
|
112
|
+
You can then use the icon in your templates:
|
|
113
|
+
|
|
114
|
+
```html
|
|
115
|
+
<ng-icon name="featherAirplay"></ng-icon>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
| Name | Type | Description |
|
|
119
|
+
| ----------- | -------------------- | ---------------------------------------------------------------------------------- |
|
|
120
|
+
| size | `string` | Define the size of the icon. This defaults to the current font size. |
|
|
121
|
+
| color | `string` | Define the color of the icon. This defaults to the current text color. |
|
|
122
|
+
| strokeWidth | `string` \| `number` | Define the stroke-width of the icon. This only works on iconsets that use strokes. |
|
|
123
|
+
|
|
124
|
+
### Standalone Components
|
|
125
|
+
|
|
126
|
+
As of version 18.0.0 Ng Icons nows supports standalone components. You can import icons using the `provideIcons` function which can be placed anywhere you can register providers. The optimal location
|
|
127
|
+
would be in the `@Component` providers array.
|
|
128
|
+
|
|
129
|
+
You can also import the component directly by importing `NgIconComponent` or the `NG_ICON_DIRECTIVES` constant.
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
import { NgIconComponent, provideIcons } from '@ng-icons/core';
|
|
133
|
+
import { featherAirplay } from '@ng-icons/feather-icons';
|
|
134
|
+
import { heroUsers } from '@ng-icons/heroicons/outline';
|
|
135
|
+
|
|
136
|
+
@Component({
|
|
137
|
+
standalone: true,
|
|
138
|
+
imports: [NgIconComponent],
|
|
139
|
+
providers: [provideIcons({ featherAirplay, heroUsers })],
|
|
140
|
+
})
|
|
141
|
+
export class AppComponent {}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Global Configuration
|
|
145
|
+
|
|
146
|
+
You can configure the default size of icons by providing a `NgIconsConfig` object to the `provideNgIconsConfig`:
|
|
147
|
+
|
|
148
|
+
#### NgModule
|
|
149
|
+
|
|
150
|
+
```ts
|
|
151
|
+
import { NgIconsModule, provideNgIconsConfig } from '@ng-icons/core';
|
|
152
|
+
import { featherAirplay } from '@ng-icons/feather-icons';
|
|
153
|
+
|
|
154
|
+
@NgModule({
|
|
155
|
+
imports: [BrowserModule, NgIconsModule.withIcons({ featherAirplay, heroUsers })],
|
|
156
|
+
providers: [
|
|
157
|
+
provideNgIconsConfig({
|
|
158
|
+
size: '1.5em',
|
|
159
|
+
color: 'red',
|
|
160
|
+
}),
|
|
161
|
+
],
|
|
162
|
+
})
|
|
163
|
+
export class AppModule {}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
#### Standalone
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
import { NgIconComponent, provideIcons, provideNgIconsConfig } from '@ng-icons/core';
|
|
170
|
+
|
|
171
|
+
bootstrapApplication(AppComponent, {
|
|
172
|
+
providers: [
|
|
173
|
+
provideNgIconsConfig({
|
|
174
|
+
size: '1.5em',
|
|
175
|
+
}),
|
|
176
|
+
],
|
|
177
|
+
});
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Dynamically Loading Icons
|
|
181
|
+
|
|
182
|
+
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.
|
|
183
|
+
|
|
184
|
+
The function is also run within the injection context, this allows you to inject dependencies as you need such as the `HttpClient`.
|
|
185
|
+
|
|
186
|
+
```ts
|
|
187
|
+
bootstrapApplication(AppComponent, {
|
|
188
|
+
providers: [
|
|
189
|
+
provideNgIconLoader(name => {
|
|
190
|
+
const http = inject(HttpClient);
|
|
191
|
+
return http.get(`/assets/icons/${name}.svg`);
|
|
192
|
+
}),
|
|
193
|
+
],
|
|
194
|
+
});
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Additionally add caching to your loader to prevent multiple requests for the same icon.
|
|
198
|
+
|
|
199
|
+
```ts
|
|
200
|
+
bootstrapApplication(AppComponent, {
|
|
201
|
+
providers: [
|
|
202
|
+
provideNgIconLoader(name => {...}, withCaching()),
|
|
203
|
+
],
|
|
204
|
+
});
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Experimental Features
|
|
208
|
+
|
|
209
|
+
### Variable Icon Fonts
|
|
210
|
+
|
|
211
|
+
We have added support for variable icon fonts. This is currently only supported by the [Material Symbols](https://github.com/marella/material-symbols/tree/main/material-symbols#readme) iconset.
|
|
212
|
+
|
|
213
|
+
To enable this feature you must install the icon font and load the `material-symbols` stylesheet. Unlike the static SVG icons, Ng Icons does not bundle the icon font, you must load it yourself.
|
|
214
|
+
|
|
215
|
+
To use it you must register the variable fonts you want to use. The default iconset will be the first one registered.
|
|
216
|
+
|
|
217
|
+
```ts
|
|
218
|
+
import { provideNgGlyphs } from '@ng-icons/core';
|
|
219
|
+
import { withMaterialSymbolsOutlined, withMaterialSymbolsRounded } from '@ng-icons/material-symbols';
|
|
220
|
+
|
|
221
|
+
bootstrapApplication(AppComponent, {
|
|
222
|
+
providers: [provideNgGlyphs(withMaterialSymbolsOutlined(), withMaterialSymbolsRounded())],
|
|
223
|
+
});
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
You can then use the following in your HTML:
|
|
227
|
+
|
|
228
|
+
```html
|
|
229
|
+
<ng-glyph name="settings" />
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
The following inputs are available on `ng-glyph`:
|
|
233
|
+
|
|
234
|
+
| Name | Type | Description |
|
|
235
|
+
| ----------- | -------------------- | ------------------------------------------------------------------------------------------------------- |
|
|
236
|
+
| name | `string` | Define the name of the icon. |
|
|
237
|
+
| glyphset | `string` | Define the glyphset to use. This defaults to the first registered glyphset. |
|
|
238
|
+
| size | `string` \| `number` | Define the size of the icon as a pixel value or as a CSS value. This defaults to the current text size. |
|
|
239
|
+
| opticalSize | `number` | Define the optical size of the icon in `px`. This defaults to `20` |
|
|
240
|
+
| color | `string` | Define the color of the icon. This defaults to the current text color. |
|
|
241
|
+
| weight | `number` | Define the weight of the icon. This defaults to `400`. |
|
|
242
|
+
| grade | `number` | Define the grade of the icon. This defaults to `0`. |
|
|
243
|
+
| fill | `boolean` | Define if the icon should be filled. This defaults to `false`. |
|
|
244
|
+
|
|
245
|
+
The default values for `size`, `weight`, `grade` and `fill` can be configured using the `provideNgGlyphsConfig` function.
|
|
246
|
+
|
|
247
|
+
```ts
|
|
248
|
+
import { provideNgGlyphsConfig } from '@ng-icons/core';
|
|
249
|
+
|
|
250
|
+
bootstrapApplication(AppComponent, {
|
|
251
|
+
providers: [
|
|
252
|
+
provideNgGlyphsConfig({
|
|
253
|
+
size: 24,
|
|
254
|
+
weight: 400,
|
|
255
|
+
grade: 0,
|
|
256
|
+
fill: false,
|
|
257
|
+
}),
|
|
258
|
+
],
|
|
259
|
+
});
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
This feature is experimental and does not follow the same versioning as the rest of the library. Breaking changes may be introduced at any time.
|
|
263
|
+
|
|
264
|
+
We appreciate any feedback you have on this feature.
|
package/bold/README.md
ADDED