Skip to content

Commit c6cc45f

Browse files
committed
Icons
1 parent 34ee895 commit c6cc45f

File tree

1 file changed

+21
-200
lines changed
  • resources/views/docs/mobile/2/edge-components

1 file changed

+21
-200
lines changed

resources/views/docs/mobile/2/edge-components/icons.md

Lines changed: 21 additions & 200 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ order: 9999
55

66
## Overview
77

8-
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
10+
[Material Icons](https://fonts.google.com/icons?icon.set=Material+Icons).
11+
12+
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.
914

1015
## How It Works
1116

@@ -15,23 +20,28 @@ The icon system uses a three-tier resolution strategy:
1520
2. **Smart Fallback** - Attempts to auto-convert unmapped icon names to platform equivalents
1621
3. **Default Fallback** - Uses a circle icon if no match is found
1722

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

2026
## Platform Differences
2127

2228
### iOS (SF Symbols)
2329

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:
2532

2633
- `home``house.fill`
2734
- `settings``gearshape.fill`
2835
- `check``checkmark.circle.fill`
2936

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`.
3139

3240
### Android (Material Icons)
3341

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

3646
Manual mappings convert common icon names to their Material Icon equivalents. For example:
3747

@@ -41,216 +51,27 @@ Manual mappings convert common icon names to their Material Icon equivalents. Fo
4151

4252
## Basic Usage
4353

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:
4555

4656
@verbatim
4757
```blade
48-
<x-native:bottom-nav-item
58+
<native:bottom-nav-item
4959
id="home"
5060
icon="home"
5161
label="Home"
5262
url="/home"
5363
/>
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-
/>
6764
```
6865
@endverbatim
6966

7067
## Icon Reference
7168

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:
226-
227-
- `{icon}.fill` (e.g., `newspaper.fill`)
228-
- `{icon}` (e.g., `newspaper`)
229-
- `{icon}.circle.fill` (e.g., `newspaper.circle.fill`)
230-
- `{icon}.square.fill` (e.g., `newspaper.square.fill`)
231-
232-
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!
24970

25071
## Best Practices
25172

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+
25376
- **Stay consistent** - Use the same icon name throughout your app for the same action
25477
- **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

Comments
 (0)