Discover our versatile React component designed to effortlessly integrate download buttons for iOS App Store, Google Play Store, and Huawei AppGallery. With our component, you can easily enhance user experience by providing seamless access to your mobile
npm install react-mobile-app-buttonbash
npm install react-mobile-app-button
`
Or, if you prefer Yarn:
`bash
yarn add react-mobile-app-button
`
Once installed, you'll have access to App Store, Google Play, and AppGallery download buttons for your web page, as shown below:
!iOS App Store Button
!Google Play Store Button
Usage
Here's an example of how to use our component in your React application:
`javascript
import { GooglePlayButton } from "react-mobile-app-button";
export const MyComponent = () => {
const APKUrl = "https://play.google.com/store/apps/details?id=host";
return (
url={APKUrl}
theme={"light"}
className={"custom-style"}
/>
);
};
`
You can also import multiple buttons at once and arrange them as needed:
`javascript
import {
GooglePlayButton,
AppGalleryButton,
ButtonsContainer,
} from "react-mobile-app-button";
export const MyComponent = () => {
const APKUrl = "https://play.google.com/store/apps/details?id=host";
const IOSUrl = "https://apps.apple.com/us/app/expo-go/id982107779";
return (
url={APKUrl}
theme={"light"}
className={"custom-style"}
/>
url={IOSUrl}
theme={"light"}
className={"custom-style"}
/>
);
};
`
Props
| Name | Component | Type | Description |
| --------- | -------------------------------------------------------- | ---------------- | --------------------------------- |
| url | GooglePlayButton, AppGalleryButton, AppStoreButton | string | Store URL |
| theme | GooglePlayButton, AppGalleryButton, AppStoreButton | "dark" / "light" | Button Theme |
| className | GooglePlayButton, AppGalleryButton, AppStoreButton | string | For manual styling |
| title | GooglePlayButton, AppGalleryButton, AppStoreButton | string | For custom message |
| height | GooglePlayButton, AppGalleryButton, AppStoreButton | number | For manual styling |
| width | GooglePlayButton, AppGalleryButton, AppStoreButton | number | For manual styling |
| gap | ButtonsContainer | number | Control the space between buttons |
| direction | ButtonsContainer | "row" / "column" | Control flex direction |
Installation and Running the Project
To install and run the project locally, follow these steps:
1. Clone the repository:
`bash
git clone https://github.com/GhassenEljday/react-mobile-app-button.git
`
2. Install the dependencies:
`bash
npm install
`
3. Run the project using Storybook:
`bash
npm run storybook
``