Skip to content

Commit 1ca00c5

Browse files
authored
Update README.md
1 parent 7ec700b commit 1ca00c5

File tree

1 file changed

+50
-19
lines changed

1 file changed

+50
-19
lines changed

README.md

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,60 @@
1+
[![MIT License](https://img.shields.io/badge/License-MIT-4b00b8?style=for-the-badge&logo=github&logoColor=white)](https://github.com/react-zero-ui/icon-sprite/blob/main/LICENSE)
2+
[![npm](https://img.shields.io/npm/v/@react-zero-ui/icon-sprite?style=for-the-badge&logo=npm&logoColor=white&label=npm&color=0044cc)](https://www.npmjs.com/package/@react-zero-ui/icon-sprite)
3+
[![View Demo](https://img.shields.io/badge/View%20Demo-%E2%86%97-4b00b8?style=for-the-badge&logo=react&logoColor=white)](https://zero-ui.dev/icon-sprite)
4+
15
<div align="center">
26

3-
# @react-zero-ui/icon-sprite
7+
<h1>React Zero Icon Sprite</h1>
48

5-
[![MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/react-zero-ui/icon-sprite/blob/main/LICENSE) [![npm](https://img.shields.io/npm/v/@react-zero-ui/icon-sprite.svg)](https://www.npmjs.com/package/@react-zero-ui/icon-sprite)
9+
<legend><b>Use over 1,600</b> Lucide <code>&lt;Icon /&gt;</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. <a target="_blank" href="https://zero-ui.dev/icon-sprite">See the Demo ↗︎</a></small>
611

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>
817
</div>
918

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.
1319

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+
<svg props="...">
30+
<use href="/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+
1543

44+
1645
---
1746

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)
2051
2152

2253

2354
---
2455

2556

26-
## 🧠 What This Library Does
57+
## What This Library Does
2758

2859
1. **Full Lucide-React DX in development**
2960
Easy imports, hot reload, JSX props - import icons from `@react-zero-ui/icon-sprite` instead of `lucide-react`.
@@ -34,7 +65,7 @@
3465
3. **Smallest possible sprite**
3566
Only icons actually used in your app are included.
3667

37-
## 🙏 Custom Icon Support
68+
## Custom Icon Support
3869
Drop SVGs into **`/public/zero-ui-icons/`**, then use `<CustomIcon />` with the filename (no `.svg`).
3970

4071
> [!TIP]
@@ -49,20 +80,20 @@ Drop SVGs into **`/public/zero-ui-icons/`**, then use `<CustomIcon />` with the
4980
><CustomIcon name="dog" size={24} />
5081
>```
5182
52-
> [!INFO]
83+
> [!NOTE]
5384
> In dev you may see a brief FOUC using custom icons; this is removed in production.
5485
5586
---
5687
57-
## 📦 Installation
88+
## Installation
5889
5990
```bash
6091
npm install @react-zero-ui/icon-sprite
6192
```
6293
6394
---
6495

65-
## Build Command
96+
## Build Command
6697
> [!CAUTION]
6798
> Run this before your app build so the sprite exists.
6899
>```bash
@@ -84,7 +115,7 @@ That's it! You can now use the icons in your app.
84115

85116
---
86117

87-
## 🔨 Usage
118+
## Usage
88119

89120
> [!WARNING]
90121
> **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";
110141

111142
---
112143

113-
## 🧪 How It Works (Under the Hood)
144+
## How It Works (Under the Hood)
114145

115-
### Development: DX First
146+
### Development: DX First
116147

117148
In dev, each icon wrapper looks like this:
118149

@@ -146,7 +177,7 @@ At build time:
146177

147178
---
148179

149-
## ⚡️ Tooling
180+
## Tooling
150181

151182
To generate everything:
152183

@@ -165,7 +196,7 @@ This runs the full pipeline:
165196

166197
---
167198

168-
## Why This Beats Icon Libraries Everywhere
199+
## Why This Beats Icon Libraries Everywhere
169200

170201
* **DX-first in dev**: No flicker. No sprite caching. Live updates.
171202
* **Zero-runtime in production**: Sprites are native, fast, lightweight & highly Cached.

0 commit comments

Comments
 (0)