store-badge

Display App Store and/or Google Play badges on your website based on the browser

View the Project on GitHub

store-badge

npm version npm bundle size License npm downloads jsDelivr

Introduction

Display App Store and/or Google Play badges on your website 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.

Integration

<p>Download Cheerswipe now!</p>
<div
  class="store-badge"
  data-name="Cheerswipe"
  data-google-play-url="https://play.google.com/store/apps/details?id=fr.puyou.cheerswipe"
  data-app-store-url="https://apps.apple.com/us/app/cheerswipe/id1468158095?ls=1"
></div>
<script
  async
  src="https://cdn.jsdelivr.net/npm/store-badge@1/build/bundle.js"
></script>

See demo

Target

If you want to open the store page in a new tab (this is mostly useful on desktop), add:

data-target="_blank"

Customization

If you wish to add some CSS to the badges, you can use the classes store-badge-app-store and store-badge-google-play.

Badges are SVG so you can scale them as needed.

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.