Skip to main content
Primer Checkout is fully customizable. You can customize colors, typography, spacing, borders, and component layout (down to the smallest visual detail) without touching internal component code or breaking upgrades.

Styling methods

On the web, Primer Checkout uses CSS variables for theming. You can apply styling in two ways - directly in your CSS or through component attributes.
styles.css

Using styling variables in practice

You can see all the available styling variables on the dedicated reference page.

Theme support

Primer Checkout supports both light and dark themes.
The default option is light. Set appearanceMode to 'DARK' to use the dark theme, or to 'SYSTEM' to follow the browser’s colour scheme. The checkout has no background of its own, so use these only on a page that is dark too or follows the same setting:
You can also pass a primer-dark-theme CSS class yourself:
You can toggle the class using JavaScript. Leave appearanceMode unset if you do, or the checkout adds the dark class back when it wants dark:

Try it out

Select a preset or adjust individual tokens to see how styling variables affect the checkout appearance.
This preview shows a subset of styling variables. Interactive states (hover, focus) are not displayed. See Styling Variables for a complete reference.

Try it live in StackBlitz

See styling in action with these interactive examples:
ExampleDescription
Theme variationsExplore light, dark and moreOpen in StackBlitz
Custom form stylingSee custom CSS styling applied to a reordered payment form layoutOpen in StackBlitz