Customize AnySpend components with slots, content overrides, themes, and CSS classes
AnySpend components support four layers of customization that can be combined for full control over appearance and behavior. Each layer targets a different concern:
Slots
Replace entire UI sections with your own components
Content
Override text and messages for different states
Theme
Configure colors and brand appearance
Classes
Apply CSS class overrides to specific elements
All core components (<AnySpend>, <AnySpendDeposit>, <AnySpendCheckout>, <AnySpendCheckoutTrigger>) accept slots, content, and theme props.
Slots let you replace entire UI sections with your own React components. Each slot receives props from AnySpend that you can use in your custom implementation.
The checkoutForm, shippingSelector, and discountInput slots are only used in <AnySpendCheckout> and <AnySpendCheckoutTrigger>. See the Checkout Guide for details on form/shipping/discount features.
<AnySpendCheckout recipientAddress="0x..." destinationTokenAddress="0x..." destinationTokenChainId={8453} items={cartItems} content={{ successTitle: "Order Confirmed!", successDescription: "Your order is being prepared. Check your email for shipping updates.", failureTitle: "Payment Failed", failureDescription: "Your card was not charged. Please try again or use a different payment method.", processingTitle: "Processing Payment...", processingDescription: "Please don't close this window. This usually takes under a minute.", returnButtonLabel: "Back to Store", retryButtonLabel: "Try Again", }}/>
Copy
Ask AI
<AnySpend recipientAddress="0x..." content={{ successTitle: "Subscription Activated!", successDescription: ( <div> <p>Welcome to Pro! Your account has been upgraded.</p> <ul> <li>Unlimited API calls</li> <li>Priority support</li> <li>Advanced analytics</li> </ul> </div> ), returnButtonLabel: "Go to Dashboard", }}/>
Copy
Ask AI
<AnySpendDeposit recipientAddress="0x..." destinationTokenAddress="0x..." destinationTokenChainId={8453} content={{ successTitle: "Tokens Deposited!", successDescription: "Your game balance has been updated. Jump back in!", expiredTitle: "Session Expired", expiredDescription: "Your deposit window has closed. Start a new deposit to continue.", returnButtonLabel: "Back to Game", }}/>
Configure the visual appearance of AnySpend components with brand colors.
AnySpendTheme Interface
Copy
Ask AI
interface AnySpendTheme { /** Primary brand color (hex). Applied as the main accent color. */ brandColor?: string; /** Individual color overrides (hex values) */ colors?: Partial<{ primary: string; // Main text color secondary: string; // Secondary text color tertiary: string; // Muted text color surfacePrimary: string; // Primary background color surfaceSecondary: string; // Secondary background (cards, panels) brand: string; // Accent/brand color (buttons, links) borderPrimary: string; // Primary border color borderSecondary: string; // Secondary border color }>;}
The brandColor prop is a shortcut that sets the brand color. If both brandColor and colors.brand are provided, colors.brand takes precedence.