Git Product home page Git Product logo

apple-pay-button's Introduction

Apple Pay Button (React) Library

Description

This is a TypeScript React library for creating an Apple Pay Button. This library follows the Apple Pay Button JavaScript guidelines. It allows you to easily integrate Apple Pay into your React applications.

Resources

Here are some resources to help you understand how this library works:

Installation

To install this library, run the following command:

npm install apple-pay-button

Usage

Here's a basic example of how to use this library:

import { ApplePayButton } from 'apple-pay-button';

function App() {
    const onClick = () => {
        // Do something
    }

  return (
    <div className="App">
      <ApplePayButton
        onClick={onClick}
        style={{
            width: '100%',
            borderRadius: '8px',
        }}
        type="continue"
    />
    </div>
  );
}

export default App;

Props

Prop Type Description
buttonStyle 'black' | 'white' | 'white-outline' The style of the Apple Pay button. Default is 'black'.
type ButtonType The type of the Apple Pay button. Default is 'buy'.
locale string The locale for the Apple Pay button. Default is 'en-US'.
onClick () => void The callback function when the Apple Pay button is clicked.
style { width?: string; height?: string; borderRadius?: string; padding?: string; boxSizing?: string; } The style object for the Apple Pay button.
disabled boolean Whether the Apple Pay button is disabled. Default is false.

Where ButtonType is one of the following: 'plain', 'add-money', 'book', 'buy', 'check-out', 'continue', 'contribute', 'donate', 'order', 'pay', 'reload', 'rent', 'set-up', 'subscribe', 'support', 'tip', 'top-up'.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT © Johan Corrales

apple-pay-button's People

Contributors

johan44co avatar

Watchers

 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.