@animateicons/react 0.1.0 → 0.1.2

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.
Files changed (2) hide show
  1. package/README.md +40 -41
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,52 +1,53 @@
1
1
  # @animateicons/react
2
2
 
3
- Animated SVG icons for React with hover and imperative animation triggers. Built on `motion/react`.
3
+ Animated SVG icons for React. Hover to animate, or drive animations imperatively from refs. 281 icons across two libraries, fully tree-shakeable, ESM + CJS, RSC-ready.
4
4
 
5
- [![npm version](https://img.shields.io/npm/v/@animateicons/react?color=f45b48)](https://www.npmjs.com/package/@animateicons/react)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-f45b48.svg)](./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.
5
+ [![npm](https://img.shields.io/npm/v/@animateicons/react?color=f45b48)](https://www.npmjs.com/package/@animateicons/react)
6
+ [![bundle](https://img.shields.io/bundlephobia/minzip/@animateicons/react)](https://bundlephobia.com/package/@animateicons/react)
7
+ [![types](https://img.shields.io/npm/types/@animateicons/react?color=blue)](https://www.npmjs.com/package/@animateicons/react)
8
+ [![license](https://img.shields.io/npm/l/@animateicons/react?color=f45b48)](./LICENSE)
11
9
 
12
10
  ## Install
13
11
 
14
12
  ```bash
15
13
  pnpm add @animateicons/react
16
- # or: npm i / bun add
17
14
  ```
18
15
 
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.
16
+ `react` and `react-dom` are peer dependencies. `motion` is bundled — no separate install needed.
20
17
 
21
18
  ## Usage
22
19
 
23
- Lucide and Huge libraries are exposed as separate subpath imports because several icon names overlap (`HeartIcon`, `CopyIcon`, etc.):
20
+ Lucide and Huge icons live on separate subpath imports because their names overlap (`HeartIcon`, `CopyIcon`, etc.):
24
21
 
25
22
  ```tsx
26
23
  import { BellRingIcon } from "@animateicons/react/lucide";
27
24
  import { HeartIcon } from "@animateicons/react/huge";
28
25
 
29
- export default function Notifications() {
26
+ export function Notifications() {
30
27
  return <BellRingIcon size={24} color="#f45b48" />;
31
28
  }
32
29
  ```
33
30
 
31
+ Hover-to-animate works out of the box. No setup, no providers.
32
+
34
33
  ## Props
35
34
 
36
35
  ```ts
37
36
  interface IconProps {
38
37
  size?: number; // default 24
39
- color?: string; // any CSS color
38
+ color?: string; // any CSS color (hex, rgb, hsl, var(--token))
40
39
  className?: string;
41
- duration?: number; // default 1 — multiplier (0.5 = 2x faster)
42
- isAnimated?: boolean; // default true
43
40
  style?: React.CSSProperties;
44
- // ...plus all standard div props
41
+ duration?: number; // animation speed multiplier — default 1, 0.5 = 2x faster
42
+ isAnimated?: boolean; // default true — false disables hover trigger
43
+ // ...all standard HTMLDivElement props
45
44
  }
46
45
  ```
47
46
 
48
47
  ## Imperative API
49
48
 
49
+ Every icon's ref exposes `startAnimation()` and `stopAnimation()`:
50
+
50
51
  ```tsx
51
52
  "use client";
52
53
  import { useRef } from "react";
@@ -55,7 +56,7 @@ import {
55
56
  type BellRingIconHandle,
56
57
  } from "@animateicons/react/lucide";
57
58
 
58
- export default function Demo() {
59
+ export function Bell() {
59
60
  const ref = useRef<BellRingIconHandle>(null);
60
61
 
61
62
  return (
@@ -69,39 +70,37 @@ export default function Demo() {
69
70
  }
70
71
  ```
71
72
 
72
- Every icon also accepts hover-to-animate by default — no setup.
73
+ The shared `IconHandle` type is also exported from the root for generic ref typing:
73
74
 
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.
75
+ ```ts
76
+ import type { IconHandle } from "@animateicons/react";
77
+ ```
77
78
 
78
- ## Bundle size
79
+ ## Accessibility
79
80
 
80
- Tree-shakeable barrel. Per-icon imports drop the rest:
81
+ All icons honor `prefers-reduced-motion` automatically. When the user has reduced motion enabled, hover and imperative triggers become no-ops. Nothing to configure.
81
82
 
82
- ```tsx
83
- import { BellRingIcon } from "@animateicons/react/lucide";
84
- // → ~3 kB gzipped, plus the shared motion/react runtime
85
- ```
83
+ ## Compatibility
86
84
 
87
- CI enforces hard size budgets (see `size-limit` config in `package.json`):
85
+ | Constraint | Supported |
86
+ | ---------------- | --------------------------------------------------- |
87
+ | React | 18 or 19 |
88
+ | Node (tooling) | ≥ 18.17 |
89
+ | Module formats | ESM + CommonJS |
90
+ | TypeScript | strict-mode types ship with the package |
91
+ | RSC / Next 13–16 | every icon carries a `"use client"` directive |
92
+ | Tree-shaking | `sideEffects: false`, ESM imports drop unused icons |
88
93
 
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
+ Published with [npm provenance](https://docs.npmjs.com/generating-provenance-statements) — every release links back to the GitHub commit that built it.
94
95
 
95
- ## Compatibility
96
+ ## Links
96
97
 
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
98
+ - **Gallery & live playground**: [animateicons.in](https://animateicons.in/icons/lucide)
99
+ - **Documentation**: [animateicons.in/icons/docs](https://animateicons.in/icons/docs)
100
+ - **Repository**: [github.com/Avijit07x/animateicons](https://github.com/Avijit07x/animateicons)
101
+ - **Changelog**: [GitHub releases](https://github.com/Avijit07x/animateicons/releases)
102
+ - **Issues**: [github.com/Avijit07x/animateicons/issues](https://github.com/Avijit07x/animateicons/issues)
102
103
 
103
104
  ## License
104
105
 
105
- [MIT](./LICENSE) — use it however you want.
106
-
107
- [Browse the gallery →](https://animateicons.in/icons/lucide) &nbsp;·&nbsp; [Source on GitHub](https://github.com/Avijit07x/animateicons)
106
+ MIT © [Avijit Dey](https://github.com/Avijit07x). See [LICENSE](./LICENSE).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@animateicons/react",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Animated SVG icons for React with hover and imperative animation triggers. Built on motion/react.",
5
5
  "license": "MIT",
6
6
  "author": "Avijit Dey",