- Getting Started
- The Basics
- Concepts
- SuperNative
-
EDGE Components
- Introduction
- Activity Indicator
- Badge
- Bottom Navigation
- Bottom Sheet
- Button
- Button Group
- Canvas
- Carousel
- Checkbox
- Chip
- Column
- Divider
- Gesture Area
- Icon
- Icons
- Image
- Layout & Styling
- List
- Menus
- Modal
- Pressable
- Progress Bar
- Radio Group
- Row
- Scroll View
- Select
- Shapes
- Side Navigation
- Slider
- Spacer
- Stack
- Tab Row
- Text
- Text Input
- Toggle
- Top Bar
- Virtual List
- Web View
- Plugins
- Testing
- Architecture
You're viewing pre-release documentation — version 4.x is in beta
Features, APIs and behaviour may change before the stable release. View the stable version (3.x)
Icon
Overview#
Displays a platform-native icon. On iOS, icons render as SF Symbols. On Android, icons render as Material Icons. A smart mapping system translates common icon names across platforms automatically.
Copied!
<native:icon name="home" :size="24" color="#1E293B" />
Props#
All shared layout and style attributes are supported, plus:
name- Icon name (required unlessios/androidare given, string). See the Icons referenceios/android- Per-platform overrides: an SF Symbol name for iOS and a Material Icon name for Android, so one tag renders the right symbol on each platform. Use in place ofnamewhen the platforms need different icons (<native:icon ios="gearshape" android="settings" />)size- Icon size in dp (optional, float, default:24)color- Icon color as hex string (optional, default: platform default)a11y-label- Accessibility label (optional). Icons are decorative by default — hidden from screen readers unless this is set. Label any icon that conveys meaning on its own. See Accessibility
Examples#
Basic icons#
Copied!
<native:row :gap="16" :align-items="1"> <native:icon name="home" :size="24" /> <native:icon name="search" :size="24" /> <native:icon name="settings" :size="24" /> <native:icon name="person" :size="24" /></native:row>
Colored icon with label#
Copied!
<native:row :gap="8" :align-items="1"> <native:icon name="check" :size="20" color="#22C55E" /> <native:text class="text-base" color="#22C55E">Verified</native:text></native:row>
Large icon#
Copied!
<native:column center :padding="32"> <native:icon name="email" :size="64" color="#94A3B8" /> <native:text class="text-lg text-slate-400">No messages</native:text></native:column>
Platform-specific icon#
Copied!
<native:icon name="{{ \Native\Mobile\Facades\System::isIos() ? 'car.side.fill' : 'directions_car' }}" :size="28"/>
Element#
Copied!
use Nativephp\NativeUi\Elements\Icon; Icon::make('home')->size(24)->color('#1E293B');
make(string $name = '')- Create an iconsize(float $size)- Icon size in dpcolor(string $hex)- Icon colora11yLabel(string $label)- Accessibility label (icons are hidden from screen readers without one)
Plugin Dev Kit
Build native plugins with
Claude Code
Learn More
NativePHP Ultra
All NativePHP plugins, teams & priority support from
$35/mo
Learn More
The Vibes
The unofficial Laracon US
Day 3
Grab Your Spot
Only 100 tickets!
The Masterclass
Go from zero to
published app
in no time
in no time
Learn More
Early Bird Pricing