Skip to main content

<primer-payment-method-container>

Automatically renders available payment methods with built-in filtering. Eliminates manual event handling and state management.
This component is useful when building custom layouts. It simplifies the creation of custom payment method layouts by automatically rendering available payment methods with built-in filtering capabilities. It eliminates the need for verbose event listeners and manual state management.

Quick Reference


Examples

All Methods

Include Specific Methods

Exclude Methods

Sectioned Layout

Disabled


Properties


Events

<primer-payment-method-container> does not emit its own events. It subscribes to parent events internally to render and filter methods automatically.

Relevant Parent Events

When you need to react to rendered methods

The container handles rendering automatically. If you need to know which methods rendered, listen on the parent:

Filter Logic

  1. If include is set, only those types render
  2. If exclude is set, those types are filtered out
  3. Both can be combined: include applies first, then exclude
  4. Renders nothing if no methods remain
Values are case-sensitive (e.g., PAYMENT_CARD not payment_card).

CSS Properties


States

Note: This component delegates visual states to its child <primer-payment-method> components.

Usage Guidelines

Do

  • Use for automatic method rendering without manual event handling
  • Create sectioned layouts with multiple containers
  • Combine include and exclude for complex filtering

Don’t

  • Don’t include PAYMENT_CARD if using a custom <primer-card-form> (causes duplicate)
  • Don’t forget: values are case-sensitive

Content Guidelines

Section headings


See also

primer-payment-method

Individual method component

Layout customization

Layout patterns