Skip to main content

Overview

Beyond colors, the Layerswap Widget offers extensive configuration options for layout, borders, header visibility, and custom styling. These options allow you to control the widget’s structure and behavior to match your application’s design system.

Theme Type Definition

The complete theme configuration type:

Border Radius

borderRadius
'none' | 'small' | 'medium' | 'large' | 'extraLarge' | 'default'
Controls the roundness of corners for cards, buttons, and other UI elements throughout the widget.

Available Options

Example:
Visual Impact:
  • Affects all cards, modals, and containers
  • Applies to buttons and interactive elements
  • Influences input fields and dropdowns
  • Consistent across all widget components

Header Customization

header
object
Configuration object for widget header visibility options. Control which elements appear in the widget header.

Hide Menu

header.hideMenu
boolean
Hide the menu button in the widget header. Set to true to remove the menu icon.

Hide Tabs

header.hideTabs
boolean
Hide the tab switcher (swap / cex / deposit) in the widget header. Set to true to lock users into a specific flow.
When hideTabs is true, users can only access the flow specified in initialValues.defaultTab. See Tab Options for more details.

Hide Wallets

header.hideWallets
boolean
Hide the wallet connection display in the widget header. Set to true to remove the wallet indicator.

Complete Header Example

This configuration creates a minimal header with no menu, no tab switcher, and no wallet display.

Card Background Style

cardBackgroundStyle
React.CSSProperties
Custom CSS styles for card backgrounds. Accepts any valid React CSS properties, enabling transparent backgrounds, blur effects, borders, and more.

Basic Transparent Background

Glassmorphism Effect

Custom Gradient

With Shadow

Supported Properties:
  • backgroundColor / background
  • backdropFilter
  • border / borderRadius
  • boxShadow
  • padding / margin
  • Any valid CSS property that works with React’s style prop
The cardBackgroundStyle applies to the main widget card container. It does not override the borderRadius theme property - use the borderRadius field for consistent corner styling.

Hide Powered By

hidePoweredBy
boolean
Remove the “Powered by Layerswap” branding from the widget footer. Set to true to hide the attribution.

Complete Configuration Example

Here’s a complete example combining all configuration options:

Testing Your Configuration

Test in Playground

Experiment with the configuration options in real-time before implementing in your application.