Component Hierarchy
- Web
- Android
- iOS
The components follow a hierarchical structure where parent components provide context to their children. Each parent literally contains its children. The spatial nesting mirrors the DOM nesting.
- Without vault
- With vault
Core Components
- Web
- Android
- iOS
| Component | Purpose |
|---|---|
<primer-checkout> | Root component that initializes the SDK and provides checkout context |
<primer-main> | Manages checkout states and provides layout customization |
<primer-payment-method> | Renders a specific payment method (card, PayPal, Apple Pay, etc.) |
<primer-payment-method-container> | Container for filtering and organizing multiple payment methods |
Card Form Components
- Web
- Android
- iOS
| Component | Purpose |
|---|---|
<primer-card-form> | Container that provides context for card inputs |
<primer-input-card-number> | Secure hosted input for card number |
<primer-input-card-expiry> | Secure hosted input for expiry date |
<primer-input-cvv> | Secure hosted input for CVV |
<primer-input-cardholder-name> | Input for cardholder name |
<primer-card-form-submit> | Submit button with built-in loading states |
<primer-input-label> | Label component for card inputs |
<primer-input-wrapper> | Wrapper for styling and layout of inputs |
<primer-billing-address> | Billing address collection form |
Utility Components
- Web
- Android
- iOS
| Component | Purpose |
|---|---|
<primer-error-message-container> | Displays payment error messages |
<primer-vault-manager> | Manages saved payment methods |
<primer-show-other-payments> | Toggle button to show additional payment methods |
Basic Usage
- Web
- Android
- iOS
How Components Communicate
Components communicate through:- Context inheritance - Child components receive context from their parents (e.g., card inputs receive form context from their parent card form)
- Events - Components emit events that you can listen to for state changes
- Customization points (Slots on Web, Composable lambdas on Android, Scope closures on iOS) - Allow you to inject custom content at specific points
For details on events, see the Events guide.
Customization at Each Level
- Web
- Android
- iOS
<primer-checkout>- SDK options, theming, global configuration<primer-main>- Layout structure through customization points<primer-payment-method>- Payment method-specific options<primer-card-form>- Complete control over card form layout and styling
See also
Using Slots
Learn how to customize layout with slots
Build a custom card form
Step-by-step tutorial for card form customization
Styles
Customize appearance with CSS variables
SDK Reference
Detailed API documentation for all components