@refineui/react-native-icons 0.3.7 → 0.3.9
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 +123 -102
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,23 +19,22 @@ pnpm add @refineui/react-native-icons
|
|
|
19
19
|
```tsx
|
|
20
20
|
import React from "react";
|
|
21
21
|
import { View, Text } from "react-native";
|
|
22
|
-
import {
|
|
22
|
+
import { Home, Search, Settings, Heart } from "@refineui/react-native-icons";
|
|
23
23
|
|
|
24
24
|
function App() {
|
|
25
25
|
return (
|
|
26
26
|
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
|
|
27
27
|
{/* Basic usage */}
|
|
28
|
-
<
|
|
28
|
+
<Home size={24} />
|
|
29
29
|
|
|
30
30
|
{/* With custom color */}
|
|
31
|
-
<
|
|
31
|
+
<Search size={20} color="#0078d4" />
|
|
32
32
|
|
|
33
33
|
{/* With custom style */}
|
|
34
|
-
<
|
|
34
|
+
<Settings size={16} style={{ marginTop: 10 }} />
|
|
35
35
|
|
|
36
36
|
{/* With onPress handler */}
|
|
37
|
-
<
|
|
38
|
-
name="heart"
|
|
37
|
+
<Heart
|
|
39
38
|
size={24}
|
|
40
39
|
onPress={() => console.log("Heart pressed!")}
|
|
41
40
|
style={{ marginTop: 10 }}
|
|
@@ -50,12 +49,11 @@ export default App;
|
|
|
50
49
|
### Touchable Icon
|
|
51
50
|
|
|
52
51
|
```tsx
|
|
53
|
-
import {
|
|
52
|
+
import { Star } from "@refineui/react-native-icons";
|
|
54
53
|
|
|
55
54
|
function TouchableIcon() {
|
|
56
55
|
return (
|
|
57
|
-
<
|
|
58
|
-
name="star"
|
|
56
|
+
<Star
|
|
59
57
|
size={24}
|
|
60
58
|
onPress={() => console.log("Star pressed!")}
|
|
61
59
|
style={{
|
|
@@ -72,14 +70,25 @@ function TouchableIcon() {
|
|
|
72
70
|
|
|
73
71
|
### Icon Categories
|
|
74
72
|
|
|
75
|
-
- **Navigation**: `
|
|
76
|
-
- **Actions**: `
|
|
77
|
-
- **Communication**: `
|
|
78
|
-
- **Media**: `
|
|
79
|
-
- **System**: `
|
|
80
|
-
- **Files**: `
|
|
73
|
+
- **Navigation**: `Home`, `Search`, `Menu`, `ArrowLeft`, `ArrowRight`, `ChevronUp`, `ChevronDown`
|
|
74
|
+
- **Actions**: `Add`, `Edit`, `Delete`, `Save`, `Cancel`, `Refresh`, `Download`, `Upload`
|
|
75
|
+
- **Communication**: `Mail`, `Phone`, `Chat`, `Notification`, `Bell`, `Message`
|
|
76
|
+
- **Media**: `Play`, `Pause`, `Stop`, `Volume`, `Mute`, `Camera`, `Image`, `Video`
|
|
77
|
+
- **System**: `Settings`, `Gear`, `Person`, `Lock`, `Unlock`, `Key`, `Shield`
|
|
78
|
+
- **Files**: `Folder`, `Document`, `Image`, `Download`
|
|
81
79
|
- **And many more...** (434+ icons total)
|
|
82
80
|
|
|
81
|
+
### Icon Naming Convention
|
|
82
|
+
|
|
83
|
+
Icons follow the pattern: `{Name}` (PascalCase)
|
|
84
|
+
|
|
85
|
+
- **Style**: `Regular` or `Filled` (imported separately)
|
|
86
|
+
- **Examples**:
|
|
87
|
+
- `Home` - Regular style home icon
|
|
88
|
+
- `HomeFilled` - Filled style home icon
|
|
89
|
+
- `Add` - Regular style add icon
|
|
90
|
+
- `AddFilled` - Filled style add icon
|
|
91
|
+
|
|
83
92
|
### Icon Sizes
|
|
84
93
|
|
|
85
94
|
- **16px**: `size={16}`
|
|
@@ -93,29 +102,35 @@ function TouchableIcon() {
|
|
|
93
102
|
### TypeScript Support
|
|
94
103
|
|
|
95
104
|
```tsx
|
|
96
|
-
import {
|
|
105
|
+
import {
|
|
106
|
+
Home,
|
|
107
|
+
Search,
|
|
108
|
+
Settings,
|
|
109
|
+
IconProps,
|
|
110
|
+
} from "@refineui/react-native-icons";
|
|
97
111
|
|
|
98
112
|
interface MyComponentProps {
|
|
99
|
-
|
|
100
|
-
iconSize?:
|
|
101
|
-
iconColor?:
|
|
102
|
-
iconStyle?: IconProps["iconStyle"];
|
|
113
|
+
iconType: "home" | "search" | "settings";
|
|
114
|
+
iconSize?: number;
|
|
115
|
+
iconColor?: string;
|
|
103
116
|
}
|
|
104
117
|
|
|
105
|
-
function MyComponent({
|
|
106
|
-
|
|
118
|
+
function MyComponent({ iconType, iconSize = 24, iconColor }: MyComponentProps) {
|
|
119
|
+
const IconComponent =
|
|
120
|
+
iconType === "home" ? Home : iconType === "search" ? Search : Settings;
|
|
121
|
+
|
|
122
|
+
return <IconComponent size={iconSize} color={iconColor} />;
|
|
107
123
|
}
|
|
108
124
|
```
|
|
109
125
|
|
|
110
126
|
### Custom Styling
|
|
111
127
|
|
|
112
128
|
```tsx
|
|
113
|
-
import {
|
|
129
|
+
import { Star } from "@refineui/react-native-icons";
|
|
114
130
|
|
|
115
131
|
function CustomIcon() {
|
|
116
132
|
return (
|
|
117
|
-
<
|
|
118
|
-
name="star"
|
|
133
|
+
<Star
|
|
119
134
|
size={24}
|
|
120
135
|
color="#ffd700"
|
|
121
136
|
style={{
|
|
@@ -133,7 +148,7 @@ function CustomIcon() {
|
|
|
133
148
|
### Dynamic Icon Selection
|
|
134
149
|
|
|
135
150
|
```tsx
|
|
136
|
-
import {
|
|
151
|
+
import { Home, Search, Settings } from "@refineui/react-native-icons";
|
|
137
152
|
|
|
138
153
|
function DynamicIcon({
|
|
139
154
|
iconType,
|
|
@@ -141,14 +156,15 @@ function DynamicIcon({
|
|
|
141
156
|
iconType: "home" | "search" | "settings";
|
|
142
157
|
}) {
|
|
143
158
|
const iconConfig = {
|
|
144
|
-
home: {
|
|
145
|
-
search: {
|
|
146
|
-
settings: {
|
|
159
|
+
home: { component: Home, color: "#0078d4" },
|
|
160
|
+
search: { component: Search, color: "#107c10" },
|
|
161
|
+
settings: { component: Settings, color: "#d83b01" },
|
|
147
162
|
};
|
|
148
163
|
|
|
149
164
|
const config = iconConfig[iconType];
|
|
165
|
+
const IconComponent = config.component;
|
|
150
166
|
|
|
151
|
-
return <
|
|
167
|
+
return <IconComponent size={24} color={config.color} />;
|
|
152
168
|
}
|
|
153
169
|
```
|
|
154
170
|
|
|
@@ -162,31 +178,32 @@ function DynamicIcon({
|
|
|
162
178
|
|
|
163
179
|
```tsx
|
|
164
180
|
import React, { useMemo } from "react";
|
|
165
|
-
import {
|
|
181
|
+
import { Home, Search, Settings } from "@refineui/react-native-icons";
|
|
166
182
|
|
|
167
|
-
function OptimizedIcon({
|
|
183
|
+
function OptimizedIcon({ iconType, size = 24 }) {
|
|
168
184
|
const iconProps = useMemo(
|
|
169
185
|
() => ({
|
|
170
|
-
name: iconName,
|
|
171
186
|
size,
|
|
172
187
|
color: "#0078d4",
|
|
173
188
|
}),
|
|
174
|
-
[
|
|
189
|
+
[size]
|
|
175
190
|
);
|
|
176
191
|
|
|
177
|
-
|
|
192
|
+
const IconComponent =
|
|
193
|
+
iconType === "home" ? Home : iconType === "search" ? Search : Settings;
|
|
194
|
+
|
|
195
|
+
return <IconComponent {...iconProps} />;
|
|
178
196
|
}
|
|
179
197
|
```
|
|
180
198
|
|
|
181
199
|
### 2. **Accessibility**
|
|
182
200
|
|
|
183
201
|
```tsx
|
|
184
|
-
import {
|
|
202
|
+
import { Search } from "@refineui/react-native-icons";
|
|
185
203
|
|
|
186
204
|
function AccessibleIcon() {
|
|
187
205
|
return (
|
|
188
|
-
<
|
|
189
|
-
name="search"
|
|
206
|
+
<Search
|
|
190
207
|
size={24}
|
|
191
208
|
accessible={true}
|
|
192
209
|
accessibilityLabel="Search"
|
|
@@ -200,27 +217,30 @@ function AccessibleIcon() {
|
|
|
200
217
|
### 3. **Responsive Design**
|
|
201
218
|
|
|
202
219
|
```tsx
|
|
203
|
-
import {
|
|
220
|
+
import { Menu } from "@refineui/react-native-icons";
|
|
204
221
|
import { Dimensions } from "react-native";
|
|
205
222
|
|
|
206
223
|
function ResponsiveIcon() {
|
|
207
224
|
const { width } = Dimensions.get("window");
|
|
208
225
|
const iconSize = width < 768 ? 20 : 24;
|
|
209
226
|
|
|
210
|
-
return <
|
|
227
|
+
return <Menu size={iconSize} />;
|
|
211
228
|
}
|
|
212
229
|
```
|
|
213
230
|
|
|
214
231
|
### 4. **Theme Integration**
|
|
215
232
|
|
|
216
233
|
```tsx
|
|
217
|
-
import {
|
|
234
|
+
import { Home, Search, Settings } from "@refineui/react-native-icons";
|
|
218
235
|
import { useTheme } from "@react-navigation/native";
|
|
219
236
|
|
|
220
|
-
function ThemedIcon({
|
|
237
|
+
function ThemedIcon({ iconType, size = 24 }) {
|
|
221
238
|
const theme = useTheme();
|
|
222
239
|
|
|
223
|
-
|
|
240
|
+
const IconComponent =
|
|
241
|
+
iconType === "home" ? Home : iconType === "search" ? Search : Settings;
|
|
242
|
+
|
|
243
|
+
return <IconComponent size={size} color={theme.colors.primary} />;
|
|
224
244
|
}
|
|
225
245
|
```
|
|
226
246
|
|
|
@@ -229,16 +249,12 @@ function ThemedIcon({ name, size = 24 }) {
|
|
|
229
249
|
### iOS Specific
|
|
230
250
|
|
|
231
251
|
```tsx
|
|
232
|
-
import {
|
|
252
|
+
import { Settings } from "@refineui/react-native-icons";
|
|
233
253
|
import { Platform } from "react-native";
|
|
234
254
|
|
|
235
255
|
function PlatformIcon() {
|
|
236
256
|
return (
|
|
237
|
-
<
|
|
238
|
-
name="settings"
|
|
239
|
-
size={24}
|
|
240
|
-
color={Platform.OS === "ios" ? "#007AFF" : "#0078d4"}
|
|
241
|
-
/>
|
|
257
|
+
<Settings size={24} color={Platform.OS === "ios" ? "#007AFF" : "#0078d4"} />
|
|
242
258
|
);
|
|
243
259
|
}
|
|
244
260
|
```
|
|
@@ -246,16 +262,12 @@ function PlatformIcon() {
|
|
|
246
262
|
### Android Specific
|
|
247
263
|
|
|
248
264
|
```tsx
|
|
249
|
-
import {
|
|
265
|
+
import { Menu } from "@refineui/react-native-icons";
|
|
250
266
|
import { Platform } from "react-native";
|
|
251
267
|
|
|
252
268
|
function AndroidIcon() {
|
|
253
269
|
return (
|
|
254
|
-
<
|
|
255
|
-
name="menu"
|
|
256
|
-
size={24}
|
|
257
|
-
color={Platform.OS === "android" ? "#6200EA" : "#0078d4"}
|
|
258
|
-
/>
|
|
270
|
+
<Menu size={24} color={Platform.OS === "android" ? "#6200EA" : "#0078d4"} />
|
|
259
271
|
);
|
|
260
272
|
}
|
|
261
273
|
```
|
|
@@ -265,16 +277,21 @@ function AndroidIcon() {
|
|
|
265
277
|
### Navigation Bar Icons
|
|
266
278
|
|
|
267
279
|
```tsx
|
|
268
|
-
import {
|
|
280
|
+
import {
|
|
281
|
+
Menu,
|
|
282
|
+
Search,
|
|
283
|
+
Notification,
|
|
284
|
+
Person,
|
|
285
|
+
} from "@refineui/react-native-icons";
|
|
269
286
|
import { View, StyleSheet } from "react-native";
|
|
270
287
|
|
|
271
288
|
function NavigationBar() {
|
|
272
289
|
return (
|
|
273
290
|
<View style={styles.navBar}>
|
|
274
|
-
<
|
|
275
|
-
<
|
|
276
|
-
<
|
|
277
|
-
<
|
|
291
|
+
<Menu size={24} style={styles.navIcon} />
|
|
292
|
+
<Search size={20} style={styles.navIcon} />
|
|
293
|
+
<Notification size={20} style={styles.navIcon} />
|
|
294
|
+
<Person size={20} style={styles.navIcon} />
|
|
278
295
|
</View>
|
|
279
296
|
);
|
|
280
297
|
}
|
|
@@ -298,57 +315,62 @@ const styles = StyleSheet.create({
|
|
|
298
315
|
### Button with Icon
|
|
299
316
|
|
|
300
317
|
```tsx
|
|
301
|
-
import {
|
|
318
|
+
import { Download } from "@refineui/react-native-icons";
|
|
302
319
|
import { TouchableOpacity, Text, StyleSheet } from "react-native";
|
|
303
320
|
|
|
304
|
-
function IconButton({
|
|
321
|
+
function IconButton({ title, onPress }) {
|
|
305
322
|
return (
|
|
306
323
|
<TouchableOpacity style={styles.button} onPress={onPress}>
|
|
307
|
-
<
|
|
324
|
+
<Download size={16} color="#fff" />
|
|
308
325
|
<Text style={styles.buttonText}>{title}</Text>
|
|
309
326
|
</TouchableOpacity>
|
|
310
327
|
);
|
|
311
328
|
}
|
|
329
|
+
```
|
|
312
330
|
|
|
313
331
|
const styles = StyleSheet.create({
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
332
|
+
button: {
|
|
333
|
+
flexDirection: "row",
|
|
334
|
+
alignItems: "center",
|
|
335
|
+
backgroundColor: "#0078d4",
|
|
336
|
+
paddingHorizontal: 16,
|
|
337
|
+
paddingVertical: 8,
|
|
338
|
+
borderRadius: 4,
|
|
339
|
+
},
|
|
340
|
+
buttonText: {
|
|
341
|
+
color: "#fff",
|
|
342
|
+
marginLeft: 8,
|
|
343
|
+
fontSize: 16,
|
|
344
|
+
},
|
|
327
345
|
});
|
|
328
|
-
|
|
346
|
+
|
|
347
|
+
````
|
|
329
348
|
|
|
330
349
|
### Icon Grid
|
|
331
350
|
|
|
332
351
|
```tsx
|
|
333
|
-
import {
|
|
352
|
+
import { Home, Search, Settings, Person, Mail, Phone } from "@refineui/react-native-icons";
|
|
334
353
|
import { View, Text, StyleSheet, FlatList } from "react-native";
|
|
335
354
|
|
|
336
355
|
function IconGrid() {
|
|
337
356
|
const icons = [
|
|
338
|
-
{ name: "home", label: "Home" },
|
|
339
|
-
{ name: "search", label: "Search" },
|
|
340
|
-
{ name: "settings", label: "Settings" },
|
|
341
|
-
{ name: "user", label: "User" },
|
|
342
|
-
{ name: "mail", label: "Mail" },
|
|
343
|
-
{ name: "phone", label: "Phone" },
|
|
357
|
+
{ component: Home, name: "home", label: "Home" },
|
|
358
|
+
{ component: Search, name: "search", label: "Search" },
|
|
359
|
+
{ component: Settings, name: "settings", label: "Settings" },
|
|
360
|
+
{ component: Person, name: "user", label: "User" },
|
|
361
|
+
{ component: Mail, name: "mail", label: "Mail" },
|
|
362
|
+
{ component: Phone, name: "phone", label: "Phone" },
|
|
344
363
|
];
|
|
345
364
|
|
|
346
|
-
const renderIcon = ({ item }) =>
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
<
|
|
350
|
-
|
|
351
|
-
|
|
365
|
+
const renderIcon = ({ item }) => {
|
|
366
|
+
const IconComponent = item.component;
|
|
367
|
+
return (
|
|
368
|
+
<View style={styles.iconItem}>
|
|
369
|
+
<IconComponent size={24} />
|
|
370
|
+
<Text style={styles.iconLabel}>{item.label}</Text>
|
|
371
|
+
</View>
|
|
372
|
+
);
|
|
373
|
+
};
|
|
352
374
|
|
|
353
375
|
return (
|
|
354
376
|
<FlatList
|
|
@@ -379,7 +401,7 @@ const styles = StyleSheet.create({
|
|
|
379
401
|
textAlign: "center",
|
|
380
402
|
},
|
|
381
403
|
});
|
|
382
|
-
|
|
404
|
+
````
|
|
383
405
|
|
|
384
406
|
## 🔍 Icon Search and Discovery
|
|
385
407
|
|
|
@@ -387,12 +409,12 @@ const styles = StyleSheet.create({
|
|
|
387
409
|
|
|
388
410
|
```tsx
|
|
389
411
|
const iconCategories = {
|
|
390
|
-
navigation: ["
|
|
391
|
-
actions: ["
|
|
392
|
-
communication: ["
|
|
393
|
-
media: ["
|
|
394
|
-
system: ["
|
|
395
|
-
files: ["
|
|
412
|
+
navigation: ["Home", "Search", "Menu", "ArrowLeft", "ArrowRight"],
|
|
413
|
+
actions: ["Add", "Edit", "Delete", "Save", "Cancel"],
|
|
414
|
+
communication: ["Mail", "Phone", "Chat", "Notification"],
|
|
415
|
+
media: ["Play", "Pause", "Stop", "Volume", "Camera"],
|
|
416
|
+
system: ["Settings", "Gear", "Person", "Lock", "Unlock"],
|
|
417
|
+
files: ["Folder", "Document", "Image", "Download"],
|
|
396
418
|
};
|
|
397
419
|
```
|
|
398
420
|
|
|
@@ -408,7 +430,7 @@ function searchIcons(query: string) {
|
|
|
408
430
|
|
|
409
431
|
// Usage
|
|
410
432
|
const searchResults = searchIcons("home");
|
|
411
|
-
// Returns: ['
|
|
433
|
+
// Returns: ['Home']
|
|
412
434
|
```
|
|
413
435
|
|
|
414
436
|
## 🛠️ Development
|
|
@@ -458,10 +480,9 @@ npm run build:react-native
|
|
|
458
480
|
|
|
459
481
|
### Getting Help
|
|
460
482
|
|
|
461
|
-
- 📧 Email: support@
|
|
462
|
-
- 🐛 Issues: [GitHub Issues](https://github.com/refineui
|
|
463
|
-
-
|
|
464
|
-
- 💬 Community: [Discord](https://discord.gg/refineui)
|
|
483
|
+
- 📧 Email: support@pelagornis.com
|
|
484
|
+
- 🐛 Issues: [GitHub Issues](https://github.com/pelagornis/refineui-system-icons/issues)
|
|
485
|
+
- 💬 Community: [Slack](https://pelagornis.slack.com)
|
|
465
486
|
|
|
466
487
|
## 📄 License
|
|
467
488
|
|