primer-web-components

Build checkout and payment flows with framework-agnostic Primer Web Components.

2|1|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/RipKDR/Steps-to-recovery --skill primer-web-components
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: primer-web-components
Source: https://github.com/RipKDR/Steps-to-recovery/tree/main/.claude/skills/primer-web-components
Command: npx skills add https://github.com/RipKDR/Steps-to-recovery --skill primer-web-components

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Primer Web Components provide a framework-agnostic set of UI elements to build checkout and payment flows across frameworks. They simplify embedding a consistent checkout experience without locking to a specific frontend framework, enabling reuse of components like primer-checkout, primer-card-form, and primer-payment-method across React, Next.js, Vue, Svelte, or vanilla JavaScript projects.

Core Features & Use Cases

  • Framework-agnostic web components for checkout and payment experiences using Primer's components.
  • Declarative and SSR-friendly; supports slots and custom events for flexible integrations.
  • Example use cases: embedding a full checkout in a React page, integrating a payment method UI in Next.js, or building a vanilla JS checkout page with accessible components.

Quick Start

Install the Primer package: npm install @primer-io/primer-js Load Primer and initialize: import { loadPrimer } from '@primer-io/primer-js'; loadPrimer(); Embed in your app: <primer-checkout client-token="YOUR_TOKEN"></primer-checkout> For React/Vue/Svelte, pass a stable options object to avoid re-initialization and ensure seamless user experience.

Frequently Asked Questions about primer-web-components

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a checkout UI with web components that works across React, Vue, and vanilla JavaScript?

You can build checkout UIs using Primer Web Components, which are framework-agnostic custom elements like <primer-checkout> that work in React, Vue, Svelte, Next.js, or vanilla JS projects. They provide declarative, SSR-friendly UI elements for consistent payment experiences without locking into a specific frontend framework.

Does Primer web component checkout support SSR in Next.js projects?

Yes, Primer web components are declarative and SSR-friendly, supporting Next.js server-side rendering. They use custom events and slots for flexible integrations, allowing you to embed payment method UIs in Next.js pages without client-only rendering limitations.

What's the best way to integrate Primer checkout into a React app without re-initialization?

The best way to integrate Primer checkout into React is by passing a stable options object to the web components. This prevents re-initialization during re-renders, ensuring a seamless user experience when embedding the <primer-checkout> component and wiring payment flow events.

How do I install and load Primer web components for a payment flow?

To install and load Primer web components, run npm install @primer-io/primer-js, then import and call loadPrimer() in your application. After initialization, embed the <primer-checkout client-token="YOUR_TOKEN"></primer-checkout> element to render the payment UI.

Can I customize the CSS theming of Primer checkout components?

Yes, you can customize CSS theming for Primer checkout components to create flexible frontends. The framework-agnostic web components support styling adjustments, allowing you to match the payment experience to your application's design system across different frameworks.