Skip to main content

Overview

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

Theme Type Definition

The complete theme configuration type:
The color schema deep-merges the supplied fields over the default theme, so you can override only the values you need. The outer LayerswapProvider receives config.theme shallowly; keep related nested values together when composing theme objects in your own code. Named Hosted Page presets do not work through initialValues.theme in the Widget packages. Use config.theme with this ThemeData shape.

Border Radius

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

Available Options

Values are pixels. --ls-border-radius-full is always 9999px; --ls-border-radius-default uses the sm value of the selected scale. 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

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

Hide Menu

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

Hide Tabs

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 Initial values & flows.

Hide Wallets

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

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.

Layout Options

boolean
Render the widget in its wide layout. Useful when the widget is the main content of a page rather than a compact embed.
boolean
Render widget dialogs and dropdowns in a document-level portal instead of inside the widget container. Enable this if your container clips overlays (e.g. overflow: hidden ancestors).
Logo accent color as an RGB triple string (e.g. '255, 50, 114').

Hide Powered By

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:

CSS Custom Properties

The theme is emitted as CSS custom properties on the widget container, which you can inspect (and, for advanced cases, override with your own CSS):
  • --ls-colors-primary, --ls-colors-primary-<100–900>, --ls-colors-primary-text
  • --ls-colors-secondary, --ls-colors-secondary-<100–900>, --ls-colors-secondary-text
  • --ls-colors-button, --ls-colors-logo, --ls-colors-text-tertiary
  • --ls-colors-warning-foreground / --ls-colors-warning-background (same for error and success)
  • --ls-border-radius-none, --ls-border-radius-sm, --ls-border-radius-md, --ls-border-radius-lg, --ls-border-radius-xl, --ls-border-radius-2xl, --ls-border-radius-3xl, --ls-border-radius-full, --ls-border-radius-default
Prefer the theme object where possible — CSS-level overrides bypass the theme’s consistency guarantees.

Testing Your Configuration

Test in Playground

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