Skip to main content
Use mode on SwapKitProvider to choose the widget’s base color scheme and theme to match your branding. The theme prop accepts a Partial<SwapKitTheme> object: every property is optional and takes a CSS value as a string. SwapKit uses named properties such as accent and radius. PayKit uses --ck-* CSS custom properties through its customTheme prop.

Apply a custom theme

After installing SwapKit, pass your theme to the provider:

Theme properties

SwapKit maps these properties to CSS custom properties inside the widget. Use the property names in the first column when passing theme.

Light and dark themes

Set mode="light" or mode="dark" for a fixed appearance. With mode="auto" (the default), SwapKit follows the user’s OS color scheme preference. Your theme overrides are applied to both built-in themes. Properties you omit retain their light or dark defaults. The example above customizes the accent, font, and corner radius while letting backgrounds and text adapt automatically. If you override backgrounds and text colors, choose values that work together in both modes, or pass a different theme when your application’s theme changes and set mode to match.