npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ios-pwa-prompt-element

v0.0.5

Published

A html custom element to help you prompt users to install your PWA capable web app on iOS.

Downloads

9

Readme

iOS PWA Prompt Element

Demo

The demo page is built to work as an interactive documentation, change the parameters, reset localStorage and reload the page to see how it works.

Demo Link

Usage

You can easily load the library from a CDN:

try jsdelivr.com CDN

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/bundle.js"></script>

try unpkg.com CDN

<script src="https://unpkg.com/[email protected]/dist/bundle.js"></script>

or npm directly

npm install ios-pwa-prompt-element

then import globally, the custom element will be automatically registered:

import 'ios-pwa-prompt-element'

NextJS usage

codesandbox demo check the app/ios-pwa-prompt-element.tsx that uses 'use client' andapp/page.tsxthat usesnext/dynamic to import it. It won't work on ssr context.

Vue usage

comming soon, will follow the same principle as react above.

Project Goals

🎯 Identify Gaps: vanilla HTML custom element with zero dependencies.

🔧 Implementation: port to address the need for a lightweight solution.

Thorough Testing: extensive testing using Cypress to ensure reliability.

📦 Publication: easy to distribute via CDN scripts or npm package import

Attributes Configuration

| Attribute | Description | Default | | ------------------------------ | ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | is-visible | Controls the visibility of the prompt | "true" | | delay | Delay in milliseconds before showing the prompt | 1000 | | prompt-on-visit | Number of visits before showing the prompt | 1 | | times-to-show | Maximum number of times to show the prompt | 1 | | installed-url | If in location.href, hides the prompt | undefined | | app-icon-path | Path to the app icon image | Website favicon or https://s2.googleusercontent.com/s2/favicons?domain=${window?.location?.origin} | | copy-add-to-home-screen-step | Text for the "Add to Home Screen" step | "Press 'Add to Home Screen'" | | copy-description | Description text for the prompt | "This website has app functionality. Add it to your home screen to use it in fullscreen and while offline." | | copy-share-step | Text for the "Share" step | "Press the 'Share' button on the menu bar below" | | copy-subtitle | Subtitle text (usually the website URL) | window?.location?.href | | copy-title | Title text for the prompt | "Add to Home Screen" |

Motivation

Background

The development of the iOS PWA prompt can be traced through several significant contributions: