Skip to main content

What is a Primer Checkout component?

Primer Checkout is built from reusable UI components. Each component represents a specific part of the checkout experience — such as the payment method selector, the card form, or the pay button — and is designed to be configured, styled, and combined without rewriting payment logic. You don’t build a checkout from scratch. You assemble and customize trusted building blocks.

What this means for you

Using Primer Checkout components allows you to:
  • Integrate a full checkout UI without managing sensitive payment inputs
  • Customize layout and appearance without breaking functionality
  • Keep a predictable and stable integration over time
  • Upgrade components without refactoring your application

Styling model

Each Primer component uses Shadow DOM, which isolates its internal HTML and CSS from your application.You cannot style internal component elements with CSS selectors. Instead, Primer exposes CSS variables as the official customization API:
:root {
  --primer-color-brand: #6c5ce7;
  --primer-radius-small: 6px;
}
This allows safe customization, consistent theming, and runtime updates without rebuilding components.

Content and layout customization

Each platform provides a way to customize the content and layout of checkout components.
Slots are named placeholders inside Web Components:
<primer-checkout client-token="...">
  <primer-main slot="main">
    <primer-card-form slot="cardForm"></primer-card-form>
    <primer-payment-methods slot="paymentMethods"></primer-payment-methods>
  </primer-main>
</primer-checkout>

Communication: events

Primer Checkout uses an event-driven architecture to communicate with your application.
Standard DOM events work with any framework:
const checkout = document.querySelector('primer-checkout');

checkout.addEventListener('primer:payment-success', (event) => {
  const { payment } = event.detail;
  window.location.href = `/confirmation?order=${payment.orderId}`;
});
EventWhen it fires
primer:readySDK is initialized and ready
primer:state-changeCheckout state changes
primer:payment-successPayment completed successfully
primer:payment-failurePayment failed
For details, see the Events Guide.

What the SDK handles

Primer Checkout handles this for you:
  • Payment method logic and processor communication
  • Input validation and error display
  • 3DS challenges and redirect flows
  • Loading states and visual feedback
  • Security and PCI compliance
You focus on integration and UX, not infrastructure.

Key takeaways

  • Primer Checkout is built from reusable, isolated components
  • Customization happens through configuration, layout customization, and styling tokens
  • Events provide decoupled communication between your app and the SDK

See also

Styling

Customize colors, fonts, and spacing

Layout

Control component arrangement and layout

Events

Handle payment lifecycle events

Components

Explore all available components