v148 · PWA · Web App
Install State Visualizer
The <install> element goes through a state machine — waiting, eligible, prompting, accepted, declined — driven by PWA install eligibility and user interaction. This visualizer walks through every state, its triggering conditions, available transitions, and the events fired at each step.
State machine
Select a state
Available transitions from current state:
PWA install eligibility checklist
Event log
<!-- HTML Install Element (Chrome 148+) -->
<install id="pwa-install">
Install this app
</install>
// Listen for state changes
const btn = document.querySelector('install');
btn.addEventListener('install', e => {
console.log('User accepted install');
});
btn.addEventListener('cancel', e => {
console.log('User declined');
});
// Read current state
console.log(btn.installState); // 'waiting' | 'eligible' | 'prompting' | 'accepted' | 'declined'
see also
- Install Button Cookbook — button patterns
- Marketplace Listing — install in a catalogue
- Cross-Origin Installer — cross-origin patterns
- Install Button Designer — custom styling
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗