InstallPrompt
PWA install prompt component for Progressive Web Apps.
Basic Usage
from faststrap import InstallPrompt
InstallPrompt(
title="Install Our App",
description="Get the best experience by installing our app!",
ios_text="Tap Share and choose Add to Home Screen.",
android_text="Tap Install to add this app to your home screen.",
delay=3000
)
API Reference
| Parameter | Type | Default | Description |
|---|---|---|---|
title |
str | "Install App" | Prompt title |
description |
str | "Add this app to your home screen for the best experience." | Prompt message |
ios_text |
str | iOS install instruction | iOS-specific helper text |
android_text |
str | Android install instruction | Android install button text |
delay |
int | 3000 |
Milliseconds before prompt appears |
**kwargs |
Any | - | Additional HTML attributes |
Example
InstallPrompt(
title="Install FastApp",
description="Install our app for offline access and faster performance!",
ios_text="Tap Share then Add to Home Screen.",
android_text="Install Now",
delay=2000
)
See Also
Behavior Notes
- Requires Bootstrap JavaScript because it uses Bootstrap Toast.
- Designed for apps that already call
add_pwa(). - iOS does not expose the same install prompt event as Chromium browsers, so the component shows manual iOS instructions.
- Android/Desktop waits for the browser
beforeinstallpromptevent before showing the install button.
API Reference
faststrap.components.feedback.install_prompt.InstallPrompt(title='Install App', description='Add this app to your home screen for the best experience.', ios_text="Tap the Share button below and select 'Add to Home Screen'.", android_text="Tap 'Install' to add to your home screen.", delay=3000, **kwargs)
A smart component that prompts users to install the PWA.
It uses client-side logic to: 1. Check if app is not in standalone mode 2. Detect platform (iOS vs Android/Desktop) 3. Show appropriate instructions via a Toast