Responsive Button Rendering


Responsive Button Rendering

Use amazon.Pay.renderButton() to render the Amazon Pay button to a HTML container element as explained in the relevant section of this guide. The button will be responsive and it will inherit the size of the container element, according to the following logic:

  • If no height or width is specified, the button container defaults to 200px by 45px.
  • If only width is specified, the button container height will be set to 45px. The provided width must be between 150px and 500px or container width will be resized to the closest supported value.
  • If only height is specified, the button container width will be set to 500px. The provided height must be between 45px and 192px or container height will be resized to the closest supported value.
  • If both height and width are specified, the button container will be resized to meet these conditions: * The container width must be between 150px and 500px. If the provided width is outside those limits, the container width will be resized to the closest supported value. * The container height must be between 45px and 192px. If the provided height is outside those limits, the container height will be resized to the closest supported value. * The container height:width ratio must be between 1:10 and 1:2.6. If the ratio is outside those limits, the container width will be set to the provided value and the container height will be adjusted to a supported ratio value.