Skip to main content

<primer-error-message-container>

Displays payment failure errors automatically. Subscribes to SDK state and shows/hides error messages without custom code.

Quick Reference


Examples

Basic Usage

With Custom Layout


What It Displays


Events

<primer-error-message-container> does not emit its own events. It subscribes to parent state internally to show and hide error messages.

Relevant Parent Events


Behavior

  • Shows when paymentFailure state is populated
  • Hides when payment succeeds or user retries
  • Includes ARIA attributes for accessibility

CSS Properties

Colors

Typography

Spacing & Shape

Animation


States


Usage Guidelines

Do

  • Include in any custom layout for error display
  • Place near the payment form for visibility

Don’t

  • Don’t use for validation errors (handled by input components)
  • Don’t use if implementing custom error handling via events

Alternative: Custom Error Handling

For full control, handle errors via events instead:

Content Guidelines

Error messages

Tone


See also

Error handling guide

Custom error patterns

primer-card-form

Card validation