Skip to content

Commit 824403e

Browse files
committed
Document direct platform icons and icon discovery resources
1 parent e4ec2a5 commit 824403e

File tree

1 file changed

+79
-13
lines changed
  • resources/views/docs/mobile/2/edge-components

1 file changed

+79
-13
lines changed

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

Lines changed: 79 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ handles the platform translation automatically.
1414

1515
## How It Works
1616

17-
The icon system uses a three-tier resolution strategy:
17+
The icon system uses a four-tier resolution strategy:
1818

19-
1. **Manual Mapping** - Explicit mappings for common icons and aliases (e.g., `home`, `settings`, `user`)
20-
2. **Smart Fallback** - Attempts to auto-convert unmapped icon names to platform equivalents
21-
3. **Default Fallback** - Uses a circle icon if no match is found
19+
1. **Direct Platform Icons** - On iOS, if the name contains a `.` it's used as a direct SF Symbol path (e.g., `car.side.fill`). On Android, any Material Icon ligature name works directly (e.g., `shopping_cart`).
20+
2. **Manual Mapping** - Explicit mappings for common icons and aliases (e.g., `home`, `settings`, `user`)
21+
3. **Smart Fallback** - Attempts to auto-convert unmapped icon names to platform equivalents
22+
4. **Default Fallback** - Uses a circle icon if no match is found
2223

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.
24+
This approach means you can use intuitive icon names for common cases, leverage direct platform icons for advanced use
25+
cases, and get consistent results across iOS and Android.
2526

2627
## Platform Differences
2728

@@ -39,15 +40,60 @@ If an icon name isn't manually mapped, the system attempts to find a matching SF
3940

4041
### Android (Material Icons)
4142

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.
43+
On Android, icons render using a lightweight font-based approach that supports the entire Material Icons library. You
44+
can use any Material Icon by its ligature name directly (e.g., `shopping_cart`, `qr_code_2`).
4545

46-
Manual mappings convert common icon names to their Material Icon equivalents. For example:
46+
Manual mappings provide convenient aliases for common icon names. For example:
4747

48-
- `home``Icons.Filled.Home`
49-
- `settings``Icons.Filled.Settings`
50-
- `check``Icons.Filled.Check`
48+
- `home``home`
49+
- `settings``settings`
50+
- `check``check`
51+
- `cart``shopping_cart`
52+
53+
## Direct Platform Icons
54+
55+
For advanced use cases, you can use platform-specific icon names directly.
56+
57+
### iOS SF Symbols
58+
59+
On iOS, include a `.` in the icon name to use an SF Symbol path directly:
60+
61+
@verbatim
62+
```blade
63+
<native:bottom-nav-item icon="car.side.fill" ... />
64+
<native:bottom-nav-item icon="flashlight.on.fill" ... />
65+
<native:bottom-nav-item icon="figure.walk" ... />
66+
```
67+
@endverbatim
68+
69+
### Android Material Icons
70+
71+
On Android, use any Material Icon ligature name (with underscores):
72+
73+
@verbatim
74+
```blade
75+
<native:bottom-nav-item icon="qr_code_2" ... />
76+
<native:bottom-nav-item icon="flashlight_on" ... />
77+
<native:bottom-nav-item icon="space_dashboard" ... />
78+
```
79+
@endverbatim
80+
81+
## Platform-Specific Icons
82+
83+
When you need different icons on each platform, use the `System` facade:
84+
85+
@verbatim
86+
```blade
87+
<native:bottom-nav-item
88+
id="flashlight"
89+
icon="{{ \Native\Mobile\Facades\System::isIos() ? 'flashlight.on.fill' : 'flashlight_on' }}"
90+
label="Flashlight"
91+
url="/flashlight"
92+
/>
93+
```
94+
@endverbatim
95+
96+
This is useful when the mapped icon doesn't match your needs or you want to use platform-specific variants.
5197

5298
## Basic Usage
5399

@@ -220,3 +266,23 @@ application across apps. So try to maintain consistent use of icons to help guid
220266

221267
- **Stay consistent** - Use the same icon name throughout your app for the same action
222268
- **Test on both platforms** - If you use auto-converted icons, verify they appear correctly on iOS and Android
269+
270+
## Finding Icons
271+
272+
### Android Material Icons
273+
274+
Browse the complete Material Icons library at [Google Fonts Icons](https://fonts.google.com/icons). Use the icon name
275+
exactly as shown (with underscores, e.g., `shopping_cart`, `qr_code_2`).
276+
277+
### iOS SF Symbols
278+
279+
Browse SF Symbols using this [community Figma file](https://www.figma.com/community/file/1549047589273604548). While not
280+
comprehensive, it's a great starting point for discovering available symbols.
281+
282+
For the complete library, download the [SF Symbols app](https://developer.apple.com/sf-symbols/) for macOS.
283+
284+
<aside>
285+
286+
SF Symbol names use dots (e.g., `house.fill`), while Material Icon names use underscores (e.g., `shopping_cart`).
287+
288+
</aside>

0 commit comments

Comments
 (0)