Skip to main content
The BasePayButton is a ready-to-use React component that provides a seamless payment experience using Base Account. It handles the entire payment flow including user interaction, transaction processing, and result handling.
Please Follow the Brand GuidelinesIf you intend on using the BasePayButton, please follow the Brand Guidelines to ensure consistency across your application.

Installation

Basic Usage

Props

paymentOptions (required)

Payment configuration object with the following properties:
amount
string
required
The payment amount in USDC (e.g., “10.50” for $10.50)
to
string
required
The recipient wallet address or ENS name
testnet
boolean
Whether to use testnet for the payment (default: false)
payerInfo
object
Object containing information requests to collect during payment

Styling Props

colorScheme
'light' | 'dark' | 'system'
Color scheme for the button appearance (default: ‘system’)
size
'small' | 'medium' | 'large'
Button size (default: ‘medium’)
variant
'solid' | 'outline'
Button variant style (default: ‘solid’)
disabled
boolean
Whether the button is disabled (default: false)

Event Handlers

onPaymentResult
function
Callback function called when payment completes (success or failure)
onClick
function
Custom click handler (called before payment processing)

Payment Options

Basic Payment

Payment with User Info Collection

Styling Options

Color Schemes

Sizes and Variants

Event Handling

Payment Result Handling

Custom Click Handler

Complete Example

TypeScript Support

The component is fully typed when using TypeScript:

Testing

For testing your integration:
  1. Use testnet mode: Set testnet: true in payment options
  2. Get test USDC: Use Circle’s faucet on Base Sepolia
  3. Test different scenarios: Try successful payments, cancellations, and errors
  4. Verify user info collection: Test with different payerInfo configurations
The BasePayButton provides a complete, production-ready payment solution that handles all the complexity of crypto payments while providing a familiar user experience.