Search code examples
dynamicantdcustomizationtheming

How to add custom dynamic theming in ant design


I want to change the theme of my entire application based on the theme coming from API.

My current implementation:

I used these steps mentioned in Antd Docs which works perfectly for a static custom theme. ( For any change made in the config the server has to be re-run )

This would not fit my current requirement as the app can't be stopped and re-run.


Solution

  • Antd supports dynamic theming

    You can follow the official Antd Docs to implement this.

    Here is a simple codesandbox to get started.

    However if you choose to not to go with experimental approach there is an another way to implement dynamic theming using a plugin.

    Check this simple guide to get started

    Note: This project is not maintained actively. Use this with caution.