Skip to content

nrgapple/useInstallPrompt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

useInstallPrompt ⚛️

A hook for accessing Google Chrome's Install button for PWAs.

npm i use-install-prompt

Usage

import React from "react"
import useInstallPrompt from "use-install-prompt"

const App: React.FC = () => {
  const [prompt, promptToInstall] = useInstallPrompt()

  return prompt ? (
    <button onClick={promptToInstall} />
  ) : (
    <h1>Browser not supported.</h1>
  )
}

Call promptToInstall to show the install prompt in Chrome.

Check if prompt is defined to deside whether to show a button or not. (On a supported browser)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published