- 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)
Modal
Overview#
A full-screen modal overlay. Visibility is driven by the visible prop. Use a bottom sheet for
contextual actions; reach for <native:modal> when you want the entire screen covered (e.g. an onboarding flow,
image preview, or detail view).
Per Model 3, backdrop and surface colors come from theme.background. The close icon uses theme.onSurfaceVariant.
Copied!
<native:modal :visible="$showDetails" @dismiss="closeDetails"> <native:column class="w-full h-full p-4 gap-4 safe-area"> <native:text class="text-2xl font-bold">Details</native:text> <native:text class="text-base">{{ $item->description }}</native:text> </native:column></native:modal>
Props#
visible- Whether the modal is shown (required, boolean)dismissible- Render a close icon and allow swipe-to-dismiss (optional, boolean, default:true)a11y-label- Accessibility label (optional)
Events#
@dismiss- Livewire method called when the user dismisses the modal (close button tap or swipe). Always handle this to keep yourvisiblestate in sync
Children#
Accepts any EDGE elements as children. The children are rendered inside the modal's content area below the
auto-supplied close button (when dismissible).
Examples#
Image preview#
Copied!
<native:modal :visible="$preview !== null" @dismiss="closePreview"> <native:column class="w-full h-full" center> <native:image src="{{ $preview }}" class="w-full" :fit="1" /> </native:column></native:modal>
Non-dismissible loading modal#
Copied!
<native:modal :visible="$processing" :dismissible="false"> <native:column fill center :gap="16"> <native:activity-indicator size="lg" /> <native:text class="text-base">Processing...</native:text> </native:column></native:modal>
Element#
Copied!
use Nativephp\NativeUi\Elements\Modal; Modal::make() ->visible($showDetails) ->dismissible(true) ->onDismiss('closeDetails');
make()- Create a modalvisible(bool $value = true)- Toggle visibilitydismissible(bool $value = true)- Allow user dismissala11yLabel(string $value)- Accessibility labelonDismiss(string $method)- Livewire method invoked on dismissal
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