Customise PayPal Component
Learn about customisation options for the PayPal component.
Overview
The PayPal component comes with responsive and accessible default styling, but is designed to be customisable.
You can find PayPal's official recommendations around button styling in their JavaScript SDK reference .
Default styling
By default, the following styling is applied to the PayPal component:
style: {
layout: 'vertical',
color: 'gold',
shape: 'rect',
label: 'paypal',
tagline: true,
height: 55,
borderRadius: 4
}
Configuration options
style: {
layout: 'vertical' | 'horizontal',
color: 'gold' | 'blue' | 'silver' | 'white' | 'black',
shape: 'rect' | 'pill' | 'sharp',
borderRadius: number,
height: number,
disableMaxHeight: boolean,
disableMaxWidth: boolean,
label: 'paypal' | 'checkout' | 'buynow' | 'pay',
tagline: boolean
},
message: {
amount: number,
align: 'center' | 'left' | 'right',
color: 'black' | 'white',
position: 'top' | 'bottom'
}
Property | Description |
---|---|
| Details about the styling options. |
| The layout of the PayPal button. Possible values:
|
| The colour of the PayPal button. Possible values:
|
| The shape of the PayPal button. Note: if Possible values:
|
| The border radius of the PayPal button, in pixels. Note: if |
| The height of the PayPal button, in pixels. |
| Whether to disable the maximum height of the PayPal button. |
| Whether to disable the maximum width of the PayPal button. |
| The label of the PayPal button. Possible values:
|
| Whether to show the tagline of the PayPal button. Set the |
| Configuration for the messaging for the most relevant Pay Later offer for every purchase. If provided, replaces the |
| Use this option to show the most relevant offer and price breakdown to your customers. Set this to a number that is greater than 0. This value should reflect the current product or cart value that will be used once a checkout session has started. |
| The alignment of the message, in relation to the button(s). Possible values:
|
| The colour of the message.
|
| The position of the message, in relation to the button(s).
|
Example
{
payeeEmailAddress: "[email protected]",
paymentDescription: "",
shippingPreference: "SET_PROVIDED_ADDRESS",
userAction: "PAY_NOW",
renderType: "standalone"
fundingSources: "paypal",
style: {
layout: "horizontal",
color: "blue",
shape: "rect",
borderRadius: 12,
height: 64,
disableMaxHeight: false,
disableMaxWidth: false,
label: "pay",
tagline: false,
},
message: {
amount: 20,
align: "left",
color: "black",
position: "top"
}
}
Updated 13 days ago