react-native-store-badges
v1.0.4
Published
A React Native library for rendering App Store and Google Play Store badges.
Downloads
52
Maintainers
Readme
Examples
Getting Started
npm install react-native-store-badges
Usage
import { StoreBadge } from "react-native-store-badges";
const MyApp = () => {
return (
<StoreBadge
platform="ios"
href="https://www.github.com" // optional
height={60} // optional
locale="da-DK" // optional
/>
);
};
Props
| Name | Type | Default | Description |
| :-------------- | :-------------------------------------: | :-------------------------------: | :---------------------------------------------------------------------------------------------------------------------- |
| platform | "ios" | "android" | required
| App Store or Play Store badge |
| locale | LocaleISO? | string? | navigator.language
or "en-US"
| Locale code |
| height | number? | 40
| Height of the badge (width is calculated) |
| href | string? | | URL of App Store or Play Store |
| target | HTMLAttributeAnchorTarget? | "_blank"
| target
-attribute is only used on Web platforms |
| style | ViewStyle? | 135
| Styles for the wrapping View (Be aware of badge guidelines) |
| customScale | BadgeScale? | | Use to temporarily correct any issues there may be with badge sizing in a specific locale. (Read more) |
Localization
Note Some locales might have different sized badges. The library attempts to handle this problem, so please create an issue or pull request, if you are experiencing this problem. To temporarily solve this problem you can provide custom scales using the
customScale
prop.
Badge Guidelines
Warning Be aware of the badge guidelines when using this library.
Known Issues
- The App Store Badge will only load the "en-US" locale on a https connection.