@primeicons/react 8.0.0-alpha.4 → 8.0.0-alpha.5
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 +53 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -143,6 +143,59 @@ Each icon automatically includes these CSS classes:
|
|
|
143
143
|
}
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
+
## Metadata & Icon Lookup
|
|
147
|
+
|
|
148
|
+
Icon metadata is managed by the `@primeicons/metadata` package and re-exported here for convenience:
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
import { ICON_MAP, ICON_MAP_BY_NAME, findIcons } from '@primeicons/metadata/react';
|
|
152
|
+
|
|
153
|
+
// Find icon by name (kebab-case)
|
|
154
|
+
const iconData = ICON_MAP_BY_NAME['check-circle'];
|
|
155
|
+
const CheckCircle = iconData.component; // Already lazy-loaded component
|
|
156
|
+
<CheckCircle size={24} />;
|
|
157
|
+
|
|
158
|
+
// Search and use
|
|
159
|
+
const results = findIcons('arrow');
|
|
160
|
+
results.forEach((icon) => {
|
|
161
|
+
const Component = icon.component;
|
|
162
|
+
<Component size={24} />;
|
|
163
|
+
});
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Alternatively, import directly from the metadata package:
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
import { ICON_MAP, findIcons } from '@primeicons/metadata/react';
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Metadata API
|
|
173
|
+
|
|
174
|
+
| Variable | Type | Description |
|
|
175
|
+
| ----------------------- | ----------------------------------- | -------------------------- |
|
|
176
|
+
| `ICON_MAP` | `IconMetadataEntry[]` | All icons as array |
|
|
177
|
+
| `ICON_MAP_BY_NAME` | `Record<string, IconMetadataEntry>` | Indexed by kebab-case name |
|
|
178
|
+
| `ICON_MAP_BY_COMPONENT` | `Record<string, IconMetadataEntry>` | Indexed by component name |
|
|
179
|
+
| `ICON_MAP_BY_CAMEL` | `Record<string, IconMetadataEntry>` | Indexed by camelCase name |
|
|
180
|
+
| `TOTAL_ICONS` | `number` | Total icon count |
|
|
181
|
+
| `PACKAGE_INFO` | `object` | Package metadata |
|
|
182
|
+
|
|
183
|
+
| Function | Returns | Description |
|
|
184
|
+
| --------------------- | --------------------- | ----------------------------- |
|
|
185
|
+
| `getIconNames()` | `string[]` | All kebab-case icon names |
|
|
186
|
+
| `getComponentNames()` | `string[]` | All component names |
|
|
187
|
+
| `findIcons(query)` | `IconMetadataEntry[]` | Search icons by partial match |
|
|
188
|
+
|
|
189
|
+
### JSON Metadata
|
|
190
|
+
|
|
191
|
+
Access the raw JSON metadata directly:
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
import metadata from '@primeicons/metadata/react.json';
|
|
195
|
+
|
|
196
|
+
console.log(manifest.icons[0]); // { name: 'address-book', component: 'AddressBook', ... }
|
|
197
|
+
```
|
|
198
|
+
|
|
146
199
|
## Icon List
|
|
147
200
|
|
|
148
201
|
The library includes 300+ icons including:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primeicons/react",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.5",
|
|
4
4
|
"author": "PrimeTek Informatics",
|
|
5
5
|
"homepage": "https://primeicons.org/",
|
|
6
6
|
"description": "PrimeIcons for React - 300+ customizable SVG icons as React components",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
],
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@primeuix/utils": "^0.6.4",
|
|
59
|
-
"@primeicons/core": "8.0.0-alpha.
|
|
59
|
+
"@primeicons/core": "8.0.0-alpha.5"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"react": ">=17"
|