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:
string
required
The payment amount in USDC (e.g., “10.50” for $10.50)
string
required
The recipient wallet address or ENS name
boolean
Whether to use testnet for the payment (default: false)
object
Object containing information requests to collect during payment

Styling Props

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

Event Handlers

function
Callback function called when payment completes (success or failure)
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.