primer-web-components

Build checkout and payment UIs with Primer web components across React, Next.js, Vue, Svelte, or vanilla JavaScript.

4|Updated Feb 14, 2025
One-click install
npx skills add https://github.com/primer-io/examples --skill primer-web-components-primer-io
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: primer-web-components
Source: https://github.com/primer-io/examples/tree/main/claude-code-skills/primer-web-components
Command: npx skills add https://github.com/primer-io/examples --skill primer-web-components-primer-io

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Primer Web Components provide a framework-agnostic way to build, customize, and themable checkout and payment experiences across React, Next.js, Vue, Svelte, or vanilla JavaScript.

Core Features & Use Cases

  • Component usage for checkout flows and card forms
  • React integration patterns, stable object references, and event handling
  • SSR support and CSS theming for brand consistency
  • Vaulting of saved payment methods and comprehensive event lifecycle

Quick Start

Install the Primer web components package and load @primer-io/primer-js in your project to start building your checkout UI.

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 Primer web components?

You can build checkout UIs by installing the Primer web components package and loading @primer-io/primer-js to leverage framework-agnostic elements, event handling, and vaulting for saved payment methods.

Can I use Primer web components with React or Next.js?

Yes, Primer web components support React and Next.js integration patterns, including stable object references and event handling, alongside Vue, Svelte, and vanilla JavaScript.

Does Primer checkout support SSR and CSS theming?

Primer checkout components support SSR and CSS theming to ensure brand consistency, allowing you to render payment UIs server-side and apply custom styles across your application.

What is the best way to handle saved payment methods in a checkout flow?

The best way to handle saved payment methods is using Primer's vaulting feature within their web components, which manages the comprehensive event lifecycle for checkout and card forms.

How do I integrate payment components into a vanilla JavaScript project?

To integrate payment components into a vanilla JavaScript project, install the Primer web components package and load the @primer-io/primer-js library to start building your checkout UI.