ng-animated-icons 0.0.1

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 ADDED
@@ -0,0 +1,133 @@
1
+ # ng-animated-icons
2
+
3
+ Bautifully crafted animated icons for Angular.
4
+
5
+ > an open-source collection of smooth, animated icons for your projects. feel free to use them, share your feedback, and let's make this library awesome together!
6
+
7
+ A port of [Moving Icons](https://www.movingicons.dev/), inspired by [lucide-animated](https://lucide-animated.com/).
8
+
9
+ Demo: <https://icons.ajitpanigrahi.com/>
10
+
11
+ ## Highlights
12
+
13
+ - ✅ Standalone Components, for Angular v19 and above. Tested on Node 22.x and Angular v21, but should work on previous versions.
14
+ - ✅ Zoneless & signals-first. RxJs is not required.
15
+ - ✅ Custom `InjectionToken` for configuring customizations in one place.
16
+
17
+ ## Installation
18
+
19
+ Install this package with the package manager of your choice.
20
+
21
+ ```bash
22
+ bun add ng-animated-icons
23
+ ```
24
+
25
+ ```bash
26
+ npm i ng-animated-icons
27
+ ```
28
+
29
+ ```bash
30
+ pnpm i ng-animated-icons
31
+ ```
32
+
33
+ ```bash
34
+ yarn add ng-animated-icons
35
+ ```
36
+
37
+ Or copy just the required icons from the repository. Use [the docs](https://icons.ajitpanigrahi.com/) to find the files and copy the source code into your project. The only relative import is for the injection token, so consider adding this file directory beside your icons or you can delete the relevant lines if you choose to skip this.
38
+
39
+ ## Usage
40
+
41
+ ### Import Path
42
+
43
+ ```ts
44
+ import { ActivityIcon, StarIcon } from 'ng-animated-icons';
45
+ ```
46
+
47
+ - All component names are in PascalCase and have an `Icon` suffix to the respective Lucide icon names. This suffix is added to avoid conflicts with other components, especially since newer Angular components don't have the `Component` suffix by default.
48
+ - All icon selectors are in lowercase and have an `i-` prefix to the respective Lucide icon names.
49
+
50
+ e.g., the `thumbs-up` icon in Lucide is available for import as `ThumbsUpIcon`, and can be used in the template as `i-thumbs-up`
51
+
52
+ ### Props
53
+
54
+ | Prop | Type | Default | Description | InjectionToken? |
55
+ | ------------- | ------- | ---------------- | ------------------------------- | --------------- |
56
+ | `color` | string | `'currentColor'` | Stroke color (CSS color value) | Yes |
57
+ | `size` | number | `24` | Icon size in pixels | Yes |
58
+ | `strokeWidth` | number | `2` | SVG stroke width | Yes |
59
+ | `class` | string | — | Optional additional CSS classes | No |
60
+ | `animate` | boolean | `false` | Controls icon animation state | No |
61
+
62
+ ### Variants
63
+
64
+ 1. **Default usage.** This uses the default values mentions in [Props](#props).
65
+
66
+ ```ts
67
+ import { ActivityIcon } from 'ng-animated-icons';
68
+ ```
69
+
70
+ ```html
71
+ <i-activity />
72
+ ```
73
+
74
+ 1. **Pass one-off options.** Inline options will be applicable to current icon only.
75
+
76
+ ```html
77
+ <!-- HTML-style attributes -->
78
+ <i-activity class="border p-4" color="purple" size="24" strokeWidth="1" />
79
+
80
+ <!-- Regular input binding for variables -->
81
+ <i-activity [class]="'border p-4'" [color]="'purple'" [size]="24" [strokeWidth]="1" />
82
+ ```
83
+
84
+ 1. **Global options.** The ideal place to configure standard settings across your app.
85
+
86
+ ```ts
87
+ // src/app/app.config.ts
88
+ import { ApplicationConfig } from '@angular/core';
89
+ import { provideAnimatedIcons } from 'ng-auto-animate';
90
+
91
+ export const appConfig: ApplicationConfig = {
92
+ providers: [
93
+ provideAnimatedIcons({ color: 'blue', size: 30, strokeWidth: 1 }),
94
+ ],
95
+ };
96
+
97
+ // main.ts
98
+ import { bootstrapApplication } from '@angular/platform-browser';
99
+ import { appConfig } from './app/app.config';
100
+ import { App } from './app/app';
101
+
102
+ bootstrapApplication(App, appConfig).catch(err => console.error(err));
103
+ ```
104
+
105
+ ```html
106
+ <!-- Will be blue, with stroke-width 1 and size 30 -->
107
+ <i-activity />
108
+
109
+ <!-- Will still be blue, with stroke-width 1 but with size 36 -->
110
+ <i-activity size="36" />
111
+
112
+ <!-- Will still be blue, with size 30 but with stroke-width 3 -->
113
+ <i-activity strokeWidth="3" />
114
+
115
+ <!-- Disregards providers since everything is overridden -->
116
+ <i-activity color="#f91377" size="36" strokeWidth="3" />
117
+ ```
118
+
119
+ <!-- TODO(docs): Add variant for hovering on parent -->
120
+
121
+ ## Missing support for something?
122
+
123
+ Go through existing issues if your problem is tracked; if not, please [raise a new issue!](https://github.com/ajitzero/animated-icons/issues/new/choose)
124
+
125
+ ## License
126
+
127
+ [MIT](https://github.com/ajitzero/animated-icons/blob/main/LICENSE).
128
+
129
+ Built by [Ajit Panigrahi](https://github.com/ajitzero).
130
+
131
+ ---
132
+
133
+ This library was generated with [Nx](https://nx.dev).