Customizing The KyberSwap Widget
Endlessly Customizable
Overview
Below you’ll find a few examples showing how you can customize the widget theme to match the look and feel of your dApp. All of them can be integrated using the following code snippet where you can set your theme
:
Customizing the title
Integrators are free to set their own widget title using ReactNode or just a string
value.
Customizing the width
Widget has a fixed height of 360px and a default width of 360px. You cannot modify the height of the widget. You can modify the width up to a minimum width of 300px.
You can customize the width by passing a valid CSS number or width to the widget's width holder.
Customizing the fees
The KyberSwap Widget makes it easy to configure a transaction facilitation fee by passing additional parameters to the widget. Information about parameters you can refer to KyberSwap Aggregator APIs.
Customizing the themes
You can set optional parameters to tailor the appearance and functionality of the swap widget to fit your app.
All attributes below are color codes, except buttonRadius
(number), borderRadius
(number between 0 and 1), and fontFamily
(string).
You can check out examples of the swap widget, and the Figma file if you want to mock it up first!
Customizing the Trade Route
The KyberSwap Widget can be configured to also return the trade route by setting the enableRoute
parameter to true
.
Moreover, you can also specify the list of DEXs which trades via the widget will be routed to using the enableDexes
parameter. The full list of DEX IDs can be found here.
Customizing the Token Lists
Last updated