You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<legend><b>Use over 1,600</b> Lucide <code><Icon /></code> in development. </br> Ship <b>one SVG sprite</b> in production - only the icons you used.</legend>
10
+
<small>Average 300% Decrease in HTML Size. <atarget="_blank"href="https://zero-ui.dev/icon-sprite">See the Demo ↗︎</a></small>
6
11
7
-
12
+
<p/>
13
+
<p/>
14
+
<p>
15
+
🔹 No React at runtime 🔹 Tree-shaken & deduped 🔹 Lucide + your custom SVGs 🔹 Long-cacheable sprite 🔹 SSR-safe
16
+
</p>
8
17
</div>
9
18
10
-
> [!NOTE]
11
-
> **Generates one SVG sprite containing only the icons you used** - Lucide + custom SVGs.
12
-
> DX with real `<Icon/>` in dev ➡️ zero-runtime `<use/>` in prod.
13
19
14
-
> Part of the [React Zero-UI](https://github.com/react-zero-ui) ecosystem.
20
+
```jsx
21
+
// Development (DX)
22
+
import { Icon } from"@react-zero-ui/icon-sprite";
23
+
24
+
<ArrowRight props="..."/>;
25
+
```
26
+
Automaitcally generates:
27
+
```html
28
+
<!-- Production output (zero runtime) -->
29
+
<svgprops="...">
30
+
<usehref="/icon.svg#arrow-right" />;
31
+
</svg>
32
+
33
+
```
34
+
35
+
Quick Start
36
+
37
+
🔹 `npm install @react-zero-ui/icon-sprite`
38
+
39
+
40
+
41
+
Part of the [React Zero-UI](https://github.com/react-zero-ui) ecosystem.
42
+
15
43
44
+
16
45
---
17
46
18
-
**📊 Live Demo - ~270% Smaller HTML**
19
-
**See the difference:**[View Demo](https://zero-ui.dev/icon-sprite)
47
+
48
+
> [!NOTE]
49
+
>**Live Demo ~270% Smaller HTML**
50
+
>**See the difference:**[View Demo](https://zero-ui.dev/icon-sprite)
20
51
21
52
22
53
23
54
---
24
55
25
56
26
-
## 🧠 What This Library Does
57
+
## What This Library Does
27
58
28
59
1.**Full Lucide-React DX in development**
29
60
Easy imports, hot reload, JSX props - import icons from `@react-zero-ui/icon-sprite` instead of `lucide-react`.
@@ -34,7 +65,7 @@
34
65
3.**Smallest possible sprite**
35
66
Only icons actually used in your app are included.
36
67
37
-
## 🙏 Custom Icon Support
68
+
## Custom Icon Support
38
69
Drop SVGs into **`/public/zero-ui-icons/`**, then use `<CustomIcon />` with the filename (no `.svg`).
39
70
40
71
> [!TIP]
@@ -49,20 +80,20 @@ Drop SVGs into **`/public/zero-ui-icons/`**, then use `<CustomIcon />` with the
49
80
><CustomIcon name="dog" size={24} />
50
81
>```
51
82
52
-
> [!INFO]
83
+
> [!NOTE]
53
84
> In dev you may see a brief FOUC using custom icons; this is removed in production.
54
85
55
86
---
56
87
57
-
## 📦 Installation
88
+
## Installation
58
89
59
90
```bash
60
91
npm install @react-zero-ui/icon-sprite
61
92
```
62
93
63
94
---
64
95
65
-
## ❗ Build Command
96
+
## Build Command
66
97
> [!CAUTION]
67
98
> Run this before your app build so the sprite exists.
68
99
>```bash
@@ -84,7 +115,7 @@ That's it! You can now use the icons in your app.
84
115
85
116
---
86
117
87
-
## 🔨 Usage
118
+
## Usage
88
119
89
120
> [!WARNING]
90
121
> **Pass `size`, or both `width` and `height`, to ensure identical dev/prod rendering.**
@@ -110,9 +141,9 @@ import { CustomIcon } from "@react-zero-ui/icon-sprite";
110
141
111
142
---
112
143
113
-
## 🧪 How It Works (Under the Hood)
144
+
## How It Works (Under the Hood)
114
145
115
-
### ✅ Development: DX First
146
+
### Development: DX First
116
147
117
148
In dev, each icon wrapper looks like this:
118
149
@@ -146,7 +177,7 @@ At build time:
146
177
147
178
---
148
179
149
-
## ⚡️ Tooling
180
+
## Tooling
150
181
151
182
To generate everything:
152
183
@@ -165,7 +196,7 @@ This runs the full pipeline:
165
196
166
197
---
167
198
168
-
## ✨ Why This Beats Icon Libraries Everywhere
199
+
## Why This Beats Icon Libraries Everywhere
169
200
170
201
***DX-first in dev**: No flicker. No sprite caching. Live updates.
171
202
***Zero-runtime in production**: Sprites are native, fast, lightweight & highly Cached.
0 commit comments