@yoroll/react-icon 0.0.18 → 0.0.19

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,59 @@
1
+ # @yoroll/react-icon
2
+
3
+ > Linear Game 图标库 — React 版本
4
+
5
+ 提供 190+ 精心设计的 SVG 图标组件,支持动态颜色、尺寸和 Tree Shaking。
6
+
7
+ ## 安装
8
+
9
+ ```bash
10
+ npm install @yoroll/react-icon
11
+ # 或
12
+ pnpm add @yoroll/react-icon
13
+ ```
14
+
15
+ ## 使用
16
+
17
+ ```tsx
18
+ import { IconAdd, IconClose, IconPlay } from '@yoroll/react-icon'
19
+
20
+ function App() {
21
+ return (
22
+ <div>
23
+ <IconAdd size={24} color="#333" />
24
+ <IconClose size={24} color="red" />
25
+ <IconPlay size={32} color="#1890ff" />
26
+ </div>
27
+ )
28
+ }
29
+ ```
30
+
31
+ ## Props
32
+
33
+ | Prop | Type | Default | Description |
34
+ |------|------|---------|-------------|
35
+ | `size` | `number` | - | 同时设置 width 和 height |
36
+ | `width` | `number` | - | 宽度(优先于 size) |
37
+ | `height` | `number` | - | 高度(优先于 size) |
38
+ | `color` | `string` | `currentColor` | 图标颜色 |
39
+ | `fill` | `string` | - | 填充色(优先于 color) |
40
+ | `stroke` | `string` | - | 描边色(优先于 color) |
41
+ | `className` | `string` | - | CSS class |
42
+
43
+ ## 类型支持
44
+
45
+ ```tsx
46
+ import type { IconProps, LGIconType } from '@yoroll/react-icon'
47
+
48
+ // 动态图标组件
49
+ const MyIcon: LGIconType = IconAdd
50
+ ```
51
+
52
+ ## 相关
53
+
54
+ - [`@yoroll/rn-icon`](https://www.npmjs.com/package/@yoroll/rn-icon) — React Native 版本
55
+ - [图标预览](https://LinearGameAI.github.io/linear-game-icons/)
56
+
57
+ ## License
58
+
59
+ ISC