Progressive Web Apps can be installed to the home screen on mobile devices and desktop on laptops and desktop computers.
The bundle provides a Stimulus Controller to ease the use of this feature.
<button
hidden
{{ stimulus_controller("@pwa/install") }}
{{ stimulus_action("@pwa/install", "install") }}
>
Install this app
</button>
On compatible browsers, a button will be displayed and trigger the installation of the web app. If the application is already installed, or the browser does not support the feature, the button will be hidden. Otherwise, a bottom sheet will be displayed with instructions on how to install the web app.