This example demonstrates how to customize Ant Design theme.
import React from 'react';
import { ConfigProvider } from 'antd';
function App() {
return (
<ConfigProvider
theme={{
token: {
colorPrimary: '#00b96b',
borderRadius: 2,
},
}}
>
<YourApp />
</ConfigProvider>
);
}
import React from 'react';
import { ConfigProvider } from 'antd';
function App() {
return (
<ConfigProvider
theme={{
token: {
colorPrimary: '#00b96b',
colorSuccess: '#52c41a',
colorWarning: '#faad14',
colorError: '#ff4d4f',
borderRadius: 4,
fontFamily: 'Arial, sans-serif',
},
}}
>
<YourApp />
</ConfigProvider>
);
}
import React from 'react';
import { ConfigProvider } from 'antd';
function App() {
return (
<ConfigProvider
theme={{
components: {
Button: {
colorPrimary: '#00b96b',
borderRadius: 2,
},
Input: {
borderRadius: 4,
},
},
}}
>
<YourApp />
</ConfigProvider>
);
}
ConfigProvider with theme proptoken propertycomponents property