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
NativePHP EDGE components use a smart icon mapping system that automatically converts icon names to platform-specific icons. On iOS, icons render as SF Symbols, while Android uses Material Icons. You use the same icon name in your Blade components, and the system handles the platform translation automatically.
8
+
NativePHP EDGE components use a smart icon mapping system that automatically converts icon names to platform-specific
9
+
icons. On iOS, icons render as [SF Symbols](https://developer.apple.com/sf-symbols/), while Android uses
You don't need to worry about the differences! Just use a single, consistent icon name in your components, and the EDGE
13
+
handles the platform translation automatically.
9
14
10
15
## How It Works
11
16
@@ -15,23 +20,28 @@ The icon system uses a three-tier resolution strategy:
15
20
2.**Smart Fallback** - Attempts to auto-convert unmapped icon names to platform equivalents
16
21
3.**Default Fallback** - Uses a circle icon if no match is found
17
22
18
-
This approach means you can use intuitive icon names and get consistent results across iOS and Android, even when the underlying platform icon names differ.
23
+
This approach means you can use intuitive icon names and get consistent results across iOS and Android, even when the
24
+
underlying platform icon names differ.
19
25
20
26
## Platform Differences
21
27
22
28
### iOS (SF Symbols)
23
29
24
-
On iOS, icons render as SF Symbols. Manual mappings convert common icon names to their SF Symbol equivalents. For example:
30
+
On iOS, icons render as SF Symbols. Manual mappings convert common icon names to their SF Symbol equivalents.
31
+
For example:
25
32
26
33
-`home` → `house.fill`
27
34
-`settings` → `gearshape.fill`
28
35
-`check` → `checkmark.circle.fill`
29
36
30
-
If an icon name isn't manually mapped, the system attempts to find a matching SF Symbol by trying variations like `.fill`, `.circle.fill`, and `.square.fill`.
37
+
If an icon name isn't manually mapped, the system attempts to find a matching SF Symbol by trying variations like
38
+
`.fill`, `.circle.fill`, and `.square.fill`.
31
39
32
40
### Android (Material Icons)
33
41
34
-
On Android, icons render as Material Icons with automatic support for filled and outlined variants. The filled variant is used by default in most components, but components like bottom navigation can switch between filled (selected) and outlined (unselected) states.
42
+
On Android, icons render as Material Icons with automatic support for filled and outlined variants. The filled variant
43
+
is used by default in most components, but components like bottom navigation can switch between filled (selected) and
44
+
outlined (unselected) states.
35
45
36
46
Manual mappings convert common icon names to their Material Icon equivalents. For example:
37
47
@@ -41,216 +51,27 @@ Manual mappings convert common icon names to their Material Icon equivalents. Fo
41
51
42
52
## Basic Usage
43
53
44
-
Use the `icon` attribute in any EDGE component that supports icons:
54
+
Use the `icon` attribute in any EDGE component that supports icons, simply passing the name of the icon you wish to use:
45
55
46
56
@verbatim
47
57
```blade
48
-
<x-native:bottom-nav-item
58
+
<native:bottom-nav-item
49
59
id="home"
50
60
icon="home"
51
61
label="Home"
52
62
url="/home"
53
63
/>
54
-
55
-
<x-native:fab
56
-
icon="add"
57
-
label="Create"
58
-
event="create-item"
59
-
/>
60
-
61
-
<x-native:side-nav-item
62
-
id="settings"
63
-
icon="settings"
64
-
label="Settings"
65
-
url="/settings"
66
-
/>
67
64
```
68
65
@endverbatim
69
66
70
67
## Icon Reference
71
68
72
-
Icons are organized by category. All icons listed here are manually mapped and guaranteed to work consistently across iOS and Android.
73
-
74
-
### Navigation
75
-
76
-
| Icon | Description |
77
-
|------|-------------|
78
-
|`dashboard`| Grid-style dashboard view |
79
-
|`home`| House/home screen |
80
-
|`menu`| Three-line hamburger menu |
81
-
|`settings`| Gear/settings |
82
-
|`account`, `profile`, `user`| User account or profile |
83
-
|`person`| Single person |
84
-
|`people`, `connections`, `contacts`| Multiple people |
85
-
|`group`, `groups`| Group of people |
86
-
87
-
### Business & Commerce
88
-
89
-
| Icon | Description |
90
-
|------|-------------|
91
-
|`orders`, `receipt`| Receipt or order |
92
-
|`cart`, `shopping`| Shopping cart |
93
-
|`shop`, `store`| Store or storefront |
94
-
|`products`, `inventory`| Products or inventory |
95
-
96
-
### Charts & Data
97
-
98
-
| Icon | Description |
99
-
|------|-------------|
100
-
|`chart`, `barchart`| Bar chart |
101
-
|`analytics`| Analytics/analysis |
102
-
|`summary`, `report`, `assessment`| Summary or report |
103
-
104
-
### Time & Scheduling
105
-
106
-
| Icon | Description |
107
-
|------|-------------|
108
-
|`clock`, `schedule`, `time`| Clock or time |
109
-
|`calendar`| Calendar |
110
-
|`history`| History or recent |
111
-
112
-
### Actions
113
-
114
-
| Icon | Description |
115
-
|------|-------------|
116
-
|`add`, `plus`| Add or create new |
117
-
|`edit`| Edit or modify |
118
-
|`delete`| Delete or remove |
119
-
|`save`| Save |
120
-
|`search`| Search |
121
-
|`filter`| Filter |
122
-
|`refresh`| Refresh or reload |
123
-
|`share`| Share |
124
-
|`download`| Download |
125
-
|`upload`| Upload |
126
-
127
-
### Communication
128
-
129
-
| Icon | Description |
130
-
|------|-------------|
131
-
|`notifications`| Notifications or alerts |
132
-
|`message`| Message or SMS |
133
-
|`email`, `mail`| Email |
134
-
|`chat`| Chat or conversation |
135
-
|`phone`| Phone or call |
136
-
137
-
### Navigation Arrows
138
-
139
-
| Icon | Description |
140
-
|------|-------------|
141
-
|`back`| Back or previous |
142
-
|`forward`| Forward or next |
143
-
|`up`| Up arrow |
144
-
|`down`| Down arrow |
145
-
146
-
### Status
147
-
148
-
| Icon | Description |
149
-
|------|-------------|
150
-
|`check`, `done`| Check or complete |
151
-
|`close`| Close or dismiss |
152
-
|`warning`| Warning |
153
-
|`error`| Error |
154
-
|`info`| Information |
155
-
156
-
### Authentication
157
-
158
-
| Icon | Description |
159
-
|------|-------------|
160
-
|`login`| Login |
161
-
|`logout`, `exit`| Logout or exit |
162
-
|`lock`| Locked |
163
-
|`unlock`| Unlocked |
164
-
165
-
### Content
166
-
167
-
| Icon | Description |
168
-
|------|-------------|
169
-
|`favorite`, `heart`| Favorite or like |
170
-
|`star`| Star or rating |
171
-
|`bookmark`| Bookmark |
172
-
|`image`, `photo`| Image or photo |
173
-
|`image-plus`| Add photo |
174
-
|`video`| Video |
175
-
|`folder`| Folder |
176
-
|`folder-lock`| Locked folder |
177
-
|`file`, `description`| Document or file |
178
-
|`book-open`| Book |
179
-
|`newspaper`, `news`, `article`| News or article |
180
-
181
-
### Device & Hardware
182
-
183
-
| Icon | Description |
184
-
|------|-------------|
185
-
|`camera`| Camera |
186
-
|`qr`, `qrcode`, `qr-code`| QR code scanner |
187
-
|`device-phone-mobile`, `smartphone`| Mobile phone |
188
-
|`vibrate`| Vibration |
189
-
|`bell`| Bell or notification |
190
-
|`finger-print`, `fingerprint`| Fingerprint or biometric |
191
-
|`light-bulb`, `lightbulb`, `flashlight`| Light bulb or flashlight |
192
-
|`map`, `location`| Map or location |
193
-
|`globe-alt`, `globe`, `web`| Globe or web |
194
-
|`bolt`, `flash`| Lightning bolt or flash |
195
-
196
-
### Audio & Volume
197
-
198
-
| Icon | Description |
199
-
|------|-------------|
200
-
|`speaker`, `speaker-wave`| Speaker with sound |
201
-
|`volume-up`| Volume up |
202
-
|`volume-down`| Volume down |
203
-
|`volume-mute`, `mute`| Muted |
204
-
|`volume-off`| Volume off |
205
-
|`music`, `audio`, `music-note`| Music or audio |
206
-
|`microphone`, `mic`| Microphone |
207
-
208
-
### Miscellaneous
209
-
210
-
| Icon | Description |
211
-
|------|-------------|
212
-
|`help`| Help or question |
213
-
|`about`, `information-circle`| Information or about |
214
-
|`more`| More options |
215
-
|`list`| List view |
216
-
|`visibility`| Visible |
217
-
|`visibility_off`| Hidden |
218
-
219
-
## Auto-Conversion
220
-
221
-
If an icon name isn't in the manual mapping, the system attempts to auto-convert it to a platform-specific icon.
222
-
223
-
### iOS Auto-Conversion
224
-
225
-
The system normalizes the icon name by removing hyphens and underscores, then tries SF Symbol patterns like:
For example, if you use `newspaper` and it's not manually mapped, the system will try to find `newspaper.fill` as an SF Symbol.
233
-
234
-
### Android Auto-Conversion
235
-
236
-
The system converts kebab-case and snake_case to PascalCase, then uses reflection to find the corresponding Material Icon in the Filled or Outlined variants.
237
-
238
-
For example, if you use `shopping-cart`, the system will:
239
-
240
-
1. Convert to PascalCase: `ShoppingCart`
241
-
2. Look for `Icons.Filled.ShoppingCart`
242
-
3. Fall back to `Icons.AutoMirrored.Filled.ShoppingCart` if the standard icon isn't found
243
-
244
-
## Custom Icons
245
-
246
-
Since the system supports auto-conversion, you can use any valid SF Symbol name on iOS or Material Icon name on Android. While we can't guarantee the icon will exist on both platforms, you can leverage platform-specific auto-conversion for icons not in the manual mapping.
247
-
248
-
For the best cross-platform experience, stick to icon names in the reference table above. These are guaranteed to work consistently across iOS and Android.
69
+
Coming soon!
249
70
250
71
## Best Practices
251
72
252
-
-**Use semantic names** - Choose icon names that match the action or concept (e.g., `home` for the home screen, not `front_page`)
73
+
Icons have meaning and most users will associate the visual cues of icons and the underlying behavior or section of an
74
+
application across apps. So try to maintain consistent use of icons to help guide users through your app.
75
+
253
76
-**Stay consistent** - Use the same icon name throughout your app for the same action
254
77
-**Test on both platforms** - If you use auto-converted icons, verify they appear correctly on iOS and Android
255
-
-**Prefer manual mappings** - Icons in the reference table are tested and consistent across platforms
256
-
-**Avoid generic names** - Use specific names like `settings` instead of just `gear`
0 commit comments