IndexPackages
react-app-store-buttons
React components for app store and platform download buttons (App Store, Google Play, Chrome Extension, Windows, macOS, Linux)

πOne Code to rule them all β and in the cloud compile them.
π€ Agent skill β npx skills@latest add https://github.com/OpenSourceAGI/dev-tools-starter-agent --skill app-store-buttons (what it covers)
React badge components for app store and platform download links. Badges ship as bundled assets β no CDN required. DEMO

Install
npm install react-native-app-buttonsImport the bundled stylesheet if your project doesn't use Tailwind:
import "react-native-app-buttons/styles";Features
- 8 platforms β iOS App Store, Google Play, Chrome Web Store, Mac App Store, Microsoft Store, Linux, Snap Store
appIdprop β pass your app identifier and the correct store URL is built automatically per platform- Native deep links β when the user is on the matching OS the button uses the native store protocol (
itms-apps://,macappstore://,market://,ms-windows-store://) so the store app opens directly autoHighlightβ detects the user's OS vianavigator.userAgentand applies a golden glow ring to the matching platform buttonhighlightβ manually force the golden glow on any buttonnewTabβ open in new tab (default) or same tabheightβ badge image height in px (default56)- Exported utilities β
getOS(),OSenum,buildStoreUrl(),buildDeepLink(),platformMatchesOS()
Usage
import { DownloadAppButton } from "react-native-app-buttons";
<DownloadAppButton platform="ios" appId="6474268307" autoHighlight />
<DownloadAppButton platform="android" appId="com.example.app" autoHighlight />
<DownloadAppButton platform="chrome-extension" appId="noecbaibfh..." autoHighlight />
<DownloadAppButton platform="macos" appId="6474268307" autoHighlight />
<DownloadAppButton platform="windows" appId="9NBLGGH4NNS1" autoHighlight />
<DownloadAppButton platform="linux-snap" appId="my-app" autoHighlight />
<DownloadAppButton platform="linux" href="https://example.com/linux" autoHighlight />Pass href instead of appId to use an explicit URL:
<DownloadAppButton platform="ios" href="https://apps.apple.com/app/id6474268307" />Props
| Prop | Type | Default | Notes |
|---|---|---|---|
platform | Platform | β | Required |
appId | string | β | Either appId or href required |
href | string | β | Either appId or href required |
autoHighlight | boolean | false | Golden glow when OS matches platform |
highlight | boolean | β | Force glow on/off; overrides autoHighlight |
newTab | boolean | true | target="_blank" |
height | number | 56 | Badge height in px |
className | string | "" | Extra classes on <a> |
alt | string | Platform label | Accessible alt text |
Deep link schemes
| Platform | Native deep link | Web fallback |
|---|---|---|
| iOS | itms-apps://itunes.apple.com/app/id{id} | https://apps.apple.com/app/id{id} |
| macOS | macappstore://itunes.apple.com/app/id{id} | https://apps.apple.com/app/id{id} |
| Android | market://details?id={pkg} | https://play.google.com/store/apps/details?id={pkg} |
| Windows | ms-windows-store://pdp/?productid={id} | https://apps.microsoft.com/detail/{id}?rtc=1 |
| Chrome | β | https://chromewebstore.google.com/detail/{id} |
| Snap | β | https://snapcraft.io/{name} |
Utilities
import { getOS, OS, platformMatchesOS, buildStoreUrl, buildDeepLink, resolveHref } from "react-native-app-buttons";
getOS() // β OS.macOS | OS.Windows | OS.Linux | β¦
platformMatchesOS("macos", getOS()) // β true on macOS
buildStoreUrl("android", "com.example.app") // β "https://play.google.com/β¦"
buildDeepLink("android", "com.example.app") // β "market://details?id=β¦"
resolveHref("android", "com.example.app", getOS()) // β deep link on Android, web elsewhereDev
npm run dev # demo at http://localhost:5173
build # library build β dist/
typecheckPlease star this repo for updates! π
Last updated on