Home > Blockchain >  any idea how to pass down style props in to @paypal/paypal-js PayPalButtons component?
any idea how to pass down style props in to @paypal/paypal-js PayPalButtons component?

Time:01-19

I am using @paypal/paypal-js from npm in react app to integrate payment, any idea how to pass down style props in the button component that this library offers ?

// Style logic form paypal devoloper
paypal.Buttons({
  style: {
    layout:  'vertical',
    color:   'blue',
    shape:   'rect',
    label:   'paypal'
  }
}).render('#paypal-button-container');

// module
import React from 'react';
import {  PayPalButtons } from '@paypal/react-paypal-js';

interface Props {}

export const PaypalCheckoutButtons: React.FC<Props> = ({}) => {
  return <PayPalButtons />;
};

CodePudding user response:

There are some examples in the documentation. For your case:

    <PayPalButtons
        style={{
            layout:  'vertical',
            color:   'blue',
            shape:   'rect',
            label:   'paypal'
        }}
    />
  •  Tags:  
  • Related