Styles

By default, payment UI components don’‎t have their own styles. You can use the predefined styles and customize them. The secured components used to display sensitive data input fields are displayed inside an iframe, that is why you can’‎t apply styles using CSS to them. To customize the secured components, refer to the instructions below.

Predefined styles

To apply styles included in the SDK to the components:

  1. Add the @xsolla/pay-station-sdk/dist/style.css file containing the styles to your project build.
  2. Add the link to styles to the HTML markup of the payment UI.

Example:

Copy
Full screen
Small screen
<html>
  <head>
    ...
    <link rel="stylesheet" href="@xsolla/pay-station-sdk/dist/style.css" />
  </head>
  ...
</html>

Applying styles to secured components

The secured components are used to enter sensitive user data. For security purposes, they are displayed on the page inside an iframe. To apply styles to these components, use the headlessCheckout.setSecureComponentStyles method.

Example:

Copy
Full screen
Small screen
await headlessCheckout.setSecureComponentStyles(`
      @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap');

      input {
        padding: 12px;
        border: 1px solid grey;
        border-radius: 8px;
        font-family: 'Roboto', sans-serif;
        font-size: 14px;
        outline: none;
      }
    `);
Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.
Last updated: March 4, 2025

Found a typo or other text error? Select the text and press Ctrl+Enter.

Report a problem
We always review our content. Your feedback helps us improve it.
Provide an email so we can follow up
Thank you for your feedback!