- Getting Started
- Architecture
- The Basics
- Digging Deeper
-
EDGE Components
- Introduction
- Accordion
- Activity Indicator
- Badge
- Bottom Navigation
- Bottom Sheet
- Button
- Button Group
- Canvas
- Carousel
- Checkbox
- Chip
- Column
- Divider
- Floating Action Button
- Gesture Area
- Icon
- Image
- Lazy Grid
- Layout & Styling
- List
- Menus
- Modal
- Pressable
- Progress Bar
- Radio Group
- Pager
- Refreshable
- Row
- Scroll View
- Select
- Shapes
- Side Navigation
- Slider
- Spacer
- Stack
- Tab Row
- Text
- Text Input
- Toggle
- Top Bar
- Virtual List
- Web View
- Plugins
- Testing
- Publishing Your App
Image
Get the Jump app
You'll need the free Jump app to preview this page on your device. Install it, then scan the code again.
Overview#
Displays an image from a URL. Loaded asynchronously by the native platform — AsyncImage on iOS, Coil on Android.
Copied!
<native:image src="https://picsum.photos/seed/nativephp/400/300" :width="200" :height="150" fit="cover" class="rounded-xl"/>
Props#
All shared layout and style attributes are supported, plus:
src- Image URL (required, string)fitChanged 4.7 - How the image fills its frame, following CSSobject-fit. Takesnone,contain,coverorfill, anImageFitcase, or the integer0/1/2/3(optional, default:contain):none(0) - Draws the image at its own size, one image pixel per point on iOS or per dp on Android, centered and cropped to the framecontain(1) - Scales the image to fit inside the frame, keeping its aspect ratio, and centers itcover(2) - Scales the image to fill the frame, keeping its aspect ratio, centered and croppedfill(3) - Stretches the image to the frame's exact width and height, ignoring its aspect ratio
tint-color- Apply a color tint as hex string (optional)alt- Accessibility alt text (optional). When set, screen readers announce the image with this label; when omitted, the image is treated as decorative and hidden from VoiceOver/TalkBack. See Accessibility
Examples#
Basic image#
Copied!
<native:image src="https://picsum.photos/seed/hero/800/400" class="w-full rounded-xl" :height="200" fit="cover" />
Rounded avatar#
Copied!
<native:image src="https://i.pravatar.cc/128?img=12" :width="64" :height="64" fit="cover" class="rounded-full"/>
Tinted icon image#
Copied!
<native:image src="https://www.php.net/images/logos/new-php-logo.png" :width="80" :height="42" fit="contain" tint-color="#7C3AED"/>
Image in a card#
Copied!
<native:column class="w-full p-2 rounded-2xl border border-theme-outline bg-theme-surface"> <native:image src="https://picsum.photos/seed/cover/800/360" class="w-full rounded-xl" :height="180" fit="cover" /> <native:column class="p-3 gap-2"> <native:text class="text-lg font-bold text-theme-on-surface">Article Title</native:text> <native:text class="text-base text-theme-on-surface-variant">A brief description of the article.</native:text> </native:column></native:column>
Element#
Copied!
use Native\Mobile\Edge\Elements\Image;use Native\Mobile\Edge\Enums\ImageFit; Image::make('https://picsum.photos/seed/nativephp/400/300') ->fit(ImageFit::Cover) ->tintColor('#7C3AED');
make(string $src = '')- Create an image with a source URLfit(int|string|ImageFit $mode)Changed 4.7 -none/contain/cover/fill, anImageFitcase, or0/1/2/3tintColor(string $hex)- Apply a color tint
NativePHP
Bring your
Laravel
skills to the
desktop.
Cloud Platform
Bifrost
Build your NativePHP apps
in the cloud.
Ship it!
Plans from $10/mo
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 Masterclass
Go from zero to
published app
in no time
in no time
Learn More