@animateicons/react 0.1.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/LICENSE +21 -0
- package/README.md +107 -0
- package/dist/chunk-B7MM7JD4.js +6 -0
- package/dist/chunk-B7MM7JD4.js.map +1 -0
- package/dist/huge.cjs +3682 -0
- package/dist/huge.cjs.map +1 -0
- package/dist/huge.d.cts +400 -0
- package/dist/huge.d.ts +400 -0
- package/dist/huge.js +3647 -0
- package/dist/huge.js.map +1 -0
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/lucide.cjs +32272 -0
- package/dist/lucide.cjs.map +1 -0
- package/dist/lucide.d.cts +2980 -0
- package/dist/lucide.d.ts +2980 -0
- package/dist/lucide.js +32022 -0
- package/dist/lucide.js.map +1 -0
- package/package.json +120 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Avijit Dey
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# @animateicons/react
|
|
2
|
+
|
|
3
|
+
Animated SVG icons for React with hover and imperative animation triggers. Built on `motion/react`.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@animateicons/react)
|
|
6
|
+
[](./LICENSE)
|
|
7
|
+
|
|
8
|
+
The same 281 icons that power [animateicons.in](https://animateicons.in), available as a tree-shakeable npm package.
|
|
9
|
+
|
|
10
|
+
> **Prefer to own the source?** Use the shadcn CLI distribution at [animateicons.in](https://animateicons.in) — every icon copies into your project as a single file.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add @animateicons/react
|
|
16
|
+
# or: npm i / bun add
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`motion` is bundled as a runtime dependency, so you don't need to install it separately. `react` and `react-dom` are peer dependencies — every React app already has them.
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Lucide and Huge libraries are exposed as separate subpath imports because several icon names overlap (`HeartIcon`, `CopyIcon`, etc.):
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { BellRingIcon } from "@animateicons/react/lucide";
|
|
27
|
+
import { HeartIcon } from "@animateicons/react/huge";
|
|
28
|
+
|
|
29
|
+
export default function Notifications() {
|
|
30
|
+
return <BellRingIcon size={24} color="#f45b48" />;
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Props
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
interface IconProps {
|
|
38
|
+
size?: number; // default 24
|
|
39
|
+
color?: string; // any CSS color
|
|
40
|
+
className?: string;
|
|
41
|
+
duration?: number; // default 1 — multiplier (0.5 = 2x faster)
|
|
42
|
+
isAnimated?: boolean; // default true
|
|
43
|
+
style?: React.CSSProperties;
|
|
44
|
+
// ...plus all standard div props
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Imperative API
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
"use client";
|
|
52
|
+
import { useRef } from "react";
|
|
53
|
+
import {
|
|
54
|
+
BellRingIcon,
|
|
55
|
+
type BellRingIconHandle,
|
|
56
|
+
} from "@animateicons/react/lucide";
|
|
57
|
+
|
|
58
|
+
export default function Demo() {
|
|
59
|
+
const ref = useRef<BellRingIconHandle>(null);
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<button
|
|
63
|
+
onMouseEnter={() => ref.current?.startAnimation()}
|
|
64
|
+
onMouseLeave={() => ref.current?.stopAnimation()}
|
|
65
|
+
>
|
|
66
|
+
<BellRingIcon ref={ref} size={28} />
|
|
67
|
+
</button>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Every icon also accepts hover-to-animate by default — no setup.
|
|
73
|
+
|
|
74
|
+
## Reduced motion
|
|
75
|
+
|
|
76
|
+
All icons respect `prefers-reduced-motion`. When the user has it enabled, hover and imperative play become no-ops. No flag to set.
|
|
77
|
+
|
|
78
|
+
## Bundle size
|
|
79
|
+
|
|
80
|
+
Tree-shakeable barrel. Per-icon imports drop the rest:
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
import { BellRingIcon } from "@animateicons/react/lucide";
|
|
84
|
+
// → ~3 kB gzipped, plus the shared motion/react runtime
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
CI enforces hard size budgets (see `size-limit` config in `package.json`):
|
|
88
|
+
|
|
89
|
+
| Entry | Budget |
|
|
90
|
+
| -------------------------------------- | ------ |
|
|
91
|
+
| `@animateicons/react/lucide` (full) | 150 kB |
|
|
92
|
+
| `@animateicons/react/huge` (full) | 30 kB |
|
|
93
|
+
| Single icon (tree-shaken) | 4 kB |
|
|
94
|
+
|
|
95
|
+
## Compatibility
|
|
96
|
+
|
|
97
|
+
- Node ≥ 18.17 for tooling (the package itself runs in any modern browser)
|
|
98
|
+
- React 18 or 19, react-dom 18 or 19
|
|
99
|
+
- ESM + CommonJS dual build
|
|
100
|
+
- React Server Components: every icon ships with a `"use client"` banner
|
|
101
|
+
- Published with [npm provenance](https://docs.npmjs.com/generating-provenance-statements) so consumers can verify the tarball came from this repo + commit
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
[MIT](./LICENSE) — use it however you want.
|
|
106
|
+
|
|
107
|
+
[Browse the gallery →](https://animateicons.in/icons/lucide) · [Source on GitHub](https://github.com/Avijit07x/animateicons)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/cn.ts"],"names":[],"mappings":";AAcO,IAAM,EAAA,GAAK,IAAI,MAAA,KACrB,MAAA,CAAO,OAAO,OAAO,CAAA,CAAE,KAAK,GAAG","file":"chunk-B7MM7JD4.js","sourcesContent":["/**\n * Minimal `cn` for @animateicons/react.\n *\n * The AnimateIcons monorepo uses clsx + tailwind-merge to drive its\n * gallery's heavy class composition. The published package's icons\n * only ever call `cn(\"static-class\", className)` with two simple\n * inputs, so we ship a 5-line filter+join instead of pulling in\n * clsx (~600B) and tailwind-merge (~5KB) as runtime dependencies.\n *\n * If a future icon needs richer behavior, swap this to clsx and add\n * it to `dependencies` in package.json.\n */\ntype ClassValue = string | undefined | null | false | 0;\n\nexport const cn = (...inputs: ClassValue[]): string =>\n\tinputs.filter(Boolean).join(\" \");\n"]}
|