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
primer-checkout {
  --primer-color-brand: #2f98ff;
  --primer-color-focus: #2f98ff;
  --primer-radius-medium: 8px;
  --primer-typography-brand: 'Inter', sans-serif;
}

Using styling variables in practice

primer-checkout {
  --primer-color-brand: #663399;
  --primer-color-focus: #663399;
  --primer-color-loader: #663399;
  --primer-color-text-primary: #333333;
  --primer-color-text-secondary: rgba(51, 51, 51, 0.62);
  --primer-typography-brand: 'Helvetica Neue', sans-serif;
  --primer-space-medium: 16px;
  --primer-radius-medium: 8px;
}
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. To use a dark theme, pass a primer-dark-theme CSS class:
<primer-checkout client-token="your-client-token" class="primer-dark-theme">
</primer-checkout>
You can toggle between themes using JavaScript:
function toggleTheme(isDark) {
  const container = document.querySelector('primer-checkout');
  container.className = isDark ? 'primer-dark-theme' : 'primer-light-theme';
}

toggleTheme(true);
toggleTheme(false);

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