Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-store-badge

apuyou424MIT3.0.0

A React component to display App Store and/or Google Play badges based on the browser

react

readme

react-store-badge

npm version npm bundle size License npm downloads

Introduction

A React component to display App Store and/or Google Play badges based on the browser.

If the browser is an iPhone or iPad, only the App Store badge will be displayed. If the browser is running on Android, only the Google Play badge will be displayed. In all other cases, both badges are shown.

Installation

$ npm i react-store-badge

If you are using Yarn:

$ yarn add react-store-badge

Usage

import React from 'react';
import StoreBadge from 'react-store-badge';

function Page() {
  return (
    <div>
      <p>Download Cheerswipe!</p>
      <StoreBadge
        name="Cheerswipe"
        googlePlayUrl="https://play.google.com/store/apps/details?id=fr.puyou.cheerswipe"
        appStoreUrl="https://apps.apple.com/us/app/cheerswipe/id1468158095?ls=1"
      />
    </div>
  );
}

export default Page;

Usage without React

If you are not using react, you should have a look at store-badge!

Apple, the Apple logo, iPhone, and iPad are trademarks of Apple Inc., registered in the U.S. and other countries and regions. App Store is a service mark of Apple Inc.

Google Play and the Google Play logo are trademarks of Google LLC.

changelog

Change Log

[3.0.0] 2021-09-12

  • Pass all props from Widget down to the created links. This allows adding a target to open stores in a new tab.

[2.0.0] 2019-12-17

  • Change prop names:
    • data-name -> name
    • data-google-play-url -> googlePlayUrl
    • data-app-store-url -> appStoreUrl

[1.0.0] 2019-12-14

  • Initial release