Download the PHP package pteal79/plugin-image-lightbox without Composer
On this page you can find all versions of the php package pteal79/plugin-image-lightbox. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pteal79/plugin-image-lightbox
More information about pteal79/plugin-image-lightbox
Files in pteal79/plugin-image-lightbox
Package plugin-image-lightbox
Short Description A NativePHP plugin that displays images in a full-screen native lightbox with zoom, pan, and share support.
License MIT
Informations about the package plugin-image-lightbox
ImageLightbox Plugin for NativePHP Mobile
Display images (jpg, jpeg, png, heic) in a full-screen native lightbox overlay above the running app UI.
Features
- Native full-screen modal on both iOS and Android
- Pinch-to-zoom (up to 5×) and pan after zooming
- Aspect-fit display by default
- Loads local file paths and remote URLs (with WebView session cookie injection for authenticated endpoints)
- Optional Edit, Markup, Share, and Delete action buttons
- Native share sheet for both local files and remote images
EditPressed,MarkupPressed,DeletePressed, andClosePressedevents withimageIdpayload- Icon-based toolbar at the top of the screen with dark-background buttons for legibility
- Safe-area aware controls; dismiss animation
- Graceful error states (invalid URL, missing file, decode failure)
Installation
Local development (path repository)
Add to your app's composer.json:
Then run composer require pteal79/plugin-image-lightbox.
Requirements
Android
| Requirement | Detail |
|---|---|
| Permission | android.permission.INTERNET (remote URLs) — added automatically via nativephp.json |
| FileProvider | The host app must have a FileProvider configured with authority ${applicationId}.provider for the Share feature to work. NativePHP Mobile typically configures this by default. |
| HEIC support | Android 9 (API 28)+ via ImageDecoder. Older devices fall back to BitmapFactory; HEIC may not decode on API < 28. |
iOS
No additional permissions or Info.plist entries are required. HEIC is supported natively via UIImage.
Usage
PHP — Livewire / Blade
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
url |
string |
null |
Remote image URL (http/https). Supported formats: jpg, jpeg, png, heic, webp. |
local |
string |
null |
Absolute local file path to an image on the device. |
imageId |
string |
null |
Optional identifier included in all event payloads. |
edit |
bool |
false |
Show an Edit button in the toolbar. |
markup |
bool |
false |
Show a Markup button in the toolbar. |
share |
bool |
false |
Show a Share button that opens the native share sheet. |
delete |
bool |
false |
Show a Delete button in the toolbar. |
Either url or local is required. If neither is provided the call is a no-op.
Events
All events are dispatched after the lightbox has dismissed. Each event carries the imageId that was passed to ::show() (or null if none was provided).
ClosePressed
Fired when the user taps the close (✕) button.
EditPressed
Fired when the user taps the Edit button (only available when edit: true).
MarkupPressed
Fired when the user taps the Markup button (only available when markup: true).
DeletePressed
Fired when the user taps the Delete button (only available when delete: true).
Event payload summary
| Event | Property | Type | Description |
|---|---|---|---|
ClosePressed |
imageId |
string\|null |
The imageId passed to ::show() |
EditPressed |
imageId |
string\|null |
The imageId passed to ::show() |
MarkupPressed |
imageId |
string\|null |
The imageId passed to ::show() |
DeletePressed |
imageId |
string\|null |
The imageId passed to ::show() |
JavaScript (Vue / React / Inertia)
Available event constants:
Toolbar
The toolbar sits at the top of the screen. Each button is a white SF Symbol (iOS) or text label (Android) on a semi-transparent dark background for legibility over any image. The close button is always present on the right; action buttons appear on the left in the order: Edit → Markup → Share → Delete.
Share behaviour
- Local file — shared directly via the native share sheet.
- Remote URL — the image is downloaded to a temporary cache file first, then shared. If the image was already loaded for display, the cached copy is reused (no second download).
- Share failures (network error, missing file) surface a toast / alert — the lightbox remains open.
Remote URL authentication
When loading a remote URL the plugin injects the current WebView session cookies into the URLSession / HttpURLConnection request automatically, so images served behind a Laravel session-authenticated route will load correctly.
Limitations
- HEIC decoding on Android requires API 28+. On older devices the image may fail to render; a graceful error message is shown.
- The plugin presents over the current top-most view controller / activity. Ensure no other full-screen modal is already covering the app when calling
::show(). - The Edit, Markup, and Delete buttons are UI affordances only — the plugin dispatches an event and dismisses. Your application is responsible for the resulting action.
- Very large images (>20 MP) may be slow to decode on low-end Android devices. Consider resizing on the server before passing to the lightbox.
- The Share feature on Android requires the host app to have a
FileProviderregistered with the authority${applicationId}.provider. NativePHP Mobile configures this by default, but if you see aFileUriExposedExceptionyou may need to add/adjust the provider in your app'sAndroidManifest.xml.
License
MIT