Skip to main content

Add to Wallet Preview

The Add to Wallet component allows your customers to add one card to Apple Wallet or Google Wallet. It renders only the wallet buttons, so you can place them in your own card UI instead of the full Card component.

Add to Apple Wallet and Add to Google Wallet buttons

Note

The element stays empty until the buttons are ready, and stays empty when no wallet can be shown. Your app owns any fallback UI.

Note

This component is web only. On iOS, Android, and React Native, keep using Add to Wallet from the Card component.

Implementation

FAQs​

How do I know whether the buttons are showing?​

Listen for unitAddToWalletWalletsAvailable and unitAddToWalletWalletsUnavailable on the element.

  • unitAddToWalletWalletsAvailable means at least one button is rendered. event.detail.wallets lists "apple", "google", or both.
  • unitAddToWalletWalletsUnavailable means nothing will be rendered. The element stays empty. event.detail.reason and event.detail.cause explain why.

Until one of those events fires, data-wallet-state is loading and nothing is rendered.

If you are not listening for events, read data-wallet-state on the element. available means the buttons are showing. unavailable means they will not be shown.