Coder Social home page Coder Social logo

cronchie / react-mobile-app-button Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ghasseneljday/react-mobile-app-button

0.0 0.0 0.0 402 KB

A react component that allows you to place an iOS App Store, Google Play Store and Huawei AppGallery Download button!

Home Page: https://www.npmjs.com/package/react-mobile-app-button?activeTab=readme

JavaScript 19.58% TypeScript 67.53% CSS 12.89%

react-mobile-app-button's Introduction

react-mobile-app-button

A react component that allows you to place an iOS App Store, Google Play Store and Huawei AppGallery Download button!

Install

install using npm

npm i react-mobile-app-button

or:

yarn add react-mobile-app-button

You will get an App Store, Google Play and AppGallery download button on Web page looks like this:

image image

Usage

Example Code:

import { GooglePlayButton } from "react-mobile-app-button";
export const MyComponent = () => {
  const APKUrl =
    "https://play.google.com/store/apps/details?id=host.exp.exponent";
  return (
    <div>
      <GooglePlayButton
        url={APKUrl}
        theme={"light"}
        className={"custom-style"}
      />
    </div>
  );
};

You can also import more than one button in a row:

import {
  GooglePlayButton,
  AppGalleryButton,
  ButtonsContainer,
} from "react-mobile-app-button";
export const MyComponent = () => {
  const APKUrl =
    "https://play.google.com/store/apps/details?id=host.exp.exponent";
  const iOSUrl = "https://apps.apple.com/us/app/expo-go/id982107779";
  return (
    <ButtonsContainer>
      <GooglePlayButton
        url={APKUrl}
        theme={"light"}
        className={"custom-style"}
      />
      <AppGalleryButton
        url={iOSUrl}
        theme={"light"}
        className={"custom-style"}
      />
    </ButtonsContainer>
  );
};

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 manually styling
height GooglePlayButton, AppGalleryButton, AppStoreButton number For manually styling
width GooglePlayButton, AppGalleryButton, AppStoreButton number For manually styling
gap ButtonsContainer number Control the space between buttons
direction ButtonsContainer "row" / "column" Control flex direction

react-mobile-app-button's People

Contributors

ghasseneljday avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.