Skip to main content
Create your own widget using the configurator https://widget.cow.fi. Demo

Install

Quick start

App key

You must specify the appCode parameter when initializing the widget. This parameter is used to identify the source of orders. The key must be a UTF8 string of up to 50 chars. It will be a part of orders meta-data, see more in the CoW Protocol Docs.

Partner fee

You may participate in the Partner Fee program to collect fee on Market order trades executed by your users through the Widget by adding the following parameter to your Widget:
This configuration will apply a partner fee for all networks and trade types (swaps, limit orders, TWAPs, etc.). You can use Flexible config for having more flexibility, or Advanced configuration to have even more control over the partner fee configuration parameters.

Flexible config

Both bps and recipient can be set for different chains and different trade types (swap/limit/advanced). Bellow you can see the partnerFee configuration variations:
See FlexibleConfig type for more information.

Advanced configuration

The partnerFee parameter can be set in a more advanced way using events. For example, you can define different fees for different assets:

Fee BPS

The fee in basis points (BPS). One basis point is equivalent to 0.01% (1/100th of a percent).
The fee cannot exceed 1% (100 bps).

Recipient

The recipient is the address to which the fee will be sent. Make sure that the fee recipient address exists on the respective network defined in the parameters. For example, if you use a Safe as a recipient and the Safe was created on Ethereum mainnet, then for Gnosis Chain you must create another Safe and set it as a fee recipient. As a fee recipient, you can specify either string or a key-value pair in the format chainId: recipientAddress:
Once you have set up the partner fee, you will see the fee in the CoW Swap UI: Partner fee Terms and conditions apply. See here for detailed info about fee calculation and examples.

Slippage configuration

The widget supports declarative slippage settings. This allows you to fine‑tune the minimum, maximum and default slippage per network.

Types

All values are basis points (bps).

Parameter

Add the slippage field to CowSwapWidgetParams:
Or configure per‑network rules using the same FlexibleConfig pattern as partnerFee:

Behaviour & validation

Example JSON (Configurator ready)

Paste the snippet into RAW JSON params → open the Swap form → check that the Settings panel reflects the configured slippage.

Wallet provider

You can pass the wallet provider from your application to seamlessly use the widget as part of your application. Also, you can not specify the provider, in this case the widget will work in standalone mode with the ability to connect any wallet supported in CoW Swap. A provider must comply with EIP-1193 and implement the interface:
An example of connecting a widget to Rabby Wallet or Metamask:

Configuration

CowSwapWidgetParams

All params are optional

Custom theme

By setting custom colors you can very flexibly control the appearance of the widget. To do this, you need to pass an object of type CowSwapWidgetPalette to the theme parameter. You actually can specify only 2 or 3 basic colors, the rest of the palette is efficiently derived (also with the help of the color2k library to get ‘AA’ rated text/background color contrasts). Example:
Try it yourself: https://widget.cow.fi. Custom theme

Custom tokens

CowSwap uses the token lists standard, which allows flexible and decentralized management of assets for trading. You can manage the list of tokens in CoW Swap UI: Tokens management In the widget you have two options to add custom tokens:
  • using tokenLists parameter
  • using customTokens parameter

tokenLists

In this parameter you can specify the URL or ENS address of the token list.
How to create and deploy your own token list you can find in the guide.

customTokens

If you want to use tokens that are not included in the default token lists, you can add them programmatically by passing an array of ERC-20 tokens info.

Events handling

The widget provides a bus of events that occur in the widget. Using it, you can receive notifications, for example, when an order has been executed or when an approval transaction has been mined. Separately, it is worth noting the ON_TOAST_MESSAGE event; it occurs every time any notification is displayed in CoW Swap. To avoid double display of notifications, enable the disableToastMessages option in the widget configurations.
A list of all possible events can be found in the source code on Github.

Events usage example

Widget updating

You can change all possible widget options on the fly:

Widget URL

Most of the widget parameters are controlled via the URL, which means that you can create the URL yourself and embed the iframe. An example of URL:

Customization

Sounds

Images

In the example below, we replace the image that is displayed when there are no orders in the limit orders table. You can replace any image in the widget in the same way.
Custom image

Banners

In some cases, you may want to hide some banners in the CoW Swap interface. To do this, you need to specify the banners parameter in the widget configuration.
This banner will be hidden: Hidden banner
Last modified on March 17, 2026