Giter Club home page Giter Club logo

react-add-to-homescreen's Introduction

react-add-to-homescreen

CircleCI License: MIT Coverage Status code style: prettier

Bringing your PWA app to iOS. Evidently.

What is it?

react-add-to-homescreen allows you to inform the iOS users that your web app is installable on the iOS home screen. It mimics the behavior of Android's Add to home screen widget visible when the user visits your PWA.

Installation

$ yarn add react-add-to-homescreen

Demo

You can check out the demo Progressive Web App here. I am not the designer of this one though ๐Ÿ˜Ž

Usage

react-add-to-homescreen is designed to be as simple as possible. First import the component:

import AddToHomescreen from 'react-add-to-homescreen';

Then add the component to the main component of your app:

<AddToHomescreen onAddToHomescreenClick={this.handleAddToHomescreenClick} />

Finally, create a handler for the banner:

handleAddToHomescreenClick = () => {
  alert(`
    1. Open Share menu
    2. Tap on "Add to Home Screen" button`);
};

Options

All options are passed as props.

Prop Type Description
onAddToHomescreenClick function function to call on banner click
title? string Custom title for banner
icon? string Icon for banner

Contributing

If you have comments, complaints, or ideas for improvements, feel free to open an issue or a pull request! If you are using or intend to use react-add-to-homescreen, please let me know ๐Ÿ™‚

License

react-add-to-homescreen was created by @kkoscielniak. It is available under the MIT license. See the LICENSE file for more info.

react-add-to-homescreen's People

Contributors

dependabot[bot] avatar joshuamabina avatar kkoscielniak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.