Customize the Klarna Express checkout buttons for the integration with flexible themes and shapes. Use the provided code snippets to implement styles quickly and easily.
The Express checkout button can be displayed on the product, cart, or checkout page, offering returning Klarna users a one-click experience that reduces friction and captures impulse purchases by streamlining the route to purchase and boosting conversion. Express checkout can make checkout 5x faster than normal.
The theme defines the button's color. The theme can be changed by setting the value of the theme attribute.
Apart from the default dark theme, the light theme can be applied to display the button in white, or the outlined theme to render the white button with an outline.
The button's default theme color is dark. As the theme attribute is optional, the default theme is applied both when the attribute is set to default and when it is omitted from the source code altogether. Avoid using the default theme on black or dark backgrounds. The button must be used on backgrounds that provide sufficient contrast.
The default theme is recommended because it is widely recognized by Klarna customers and looks good on light backgrounds.
JAVASCRIPT
1
2
3
4
5
klarna.Payment.button({
theme: "default", // Used to set the theme of the button
...
}).mount('#container')
Sample code to render the default Express checkout button.
Use the light theme to make the button visible on dark backgrounds. To apply the light theme, set the theme attribute to light. Avoid using the light theme on white or light backgrounds. The button must be used on backgrounds that provide sufficient contrast.
JAVASCRIPT
1
2
3
4
5
klarna.Payment.button({
theme: "light", // Used to set the theme of the button to light
...
}).mount('#container')
Sample code to render a white Express checkout button.
Use the outlined theme to make the button visible on all backgrounds. To apply this theme, set the theme attribute to outlined. Avoid placing the button on dark or saturated backgrounds. The button must be used on backgrounds that provide sufficient contrast.
JAVASCRIPT
1
2
3
4
5
klarna.Payment.button({
theme: "outlined", // Used to set the theme of the button
...
}).mount('#container')
Sample code to render a white, outlined Express checkout button.
Customizing the shape of the button to match the site's look and feel is a key step in creating a visually cohesive and engaging user experience. To control the button's shape, change the value of the shape attribute.
There are three shapes available with the Express checkout button: default, rectangular, and pill.
The default recommended height of the Klarna button is 48px and the minimum height allowed is 40px. Ensure the button has the same height as other payment buttons.
There are three ways to display the Klarna trademark on the button: badge, left icon, or centered icon. These variants are available to ensure there is a button variant aligned with the Partner's UI patterns. To control the button's alignment, change the value of the logoAlignment attribute.
The default alignment is the Klarna badge centered with text before. To apply the default shape, set the logAlignment attribute of the Identity.button() function to default.