Fullscreen
Browser Support
Usage
Fullscreen for Entire Page
<section {{ stimulus_controller('@pwa/fullscreen') }}>
<h1>My Presentation</h1>
<div class="content">
<!-- Your content here -->
</div>
<button {{ stimulus_action('@pwa/fullscreen', 'request', 'click') }}>
Enter Fullscreen
</button>
<button {{ stimulus_action('@pwa/fullscreen', 'exit', 'click') }}>
Exit Fullscreen
</button>
</section>
<script>
document.addEventListener('pwa--fullscreen:change', (event) => {
const { fullscreen, element } = event.detail;
console.log('Fullscreen:', fullscreen ? 'active' : 'inactive');
});
</script>Fullscreen for Specific Element
Video Player with Fullscreen
Image Gallery with Fullscreen
Presentation Mode with Navigation
Parameters
Actions
request
requestexit
exitTargets
Events
pwa--fullscreen:change
pwa--fullscreen:changepwa--fullscreen:error
pwa--fullscreen:errorBest Practices
Common Use Cases
Media Player Controls
Dashboard Fullscreen
Photo Viewer with Gestures
Browser-Specific Considerations
Safari (iOS)
Chrome/Edge
Firefox
CSS for Fullscreen Mode
Troubleshooting
Fullscreen not working
Element not displaying correctly
Complete Example: Video Player
Last updated
Was this helpful?