apple-pay-button
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

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

Package Sidebar

Install

npm i apple-pay-button

Weekly Downloads

188

Version

1.1.2

License

MIT

Unpacked Size

27.9 kB

Total Files

9

Last publish

Collaborators

  • popterminal