mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +08:00
e7aa014c31
* docs: init * chore: all types * docs: faq * chore: fix lint
25 lines
639 B
TypeScript
25 lines
639 B
TypeScript
import React, { useState } from 'react';
|
|
import { ConfigProvider, FloatButton, Slider } from 'antd';
|
|
import type { ConfigProviderProps, GetProp } from 'antd';
|
|
|
|
type AliasToken = GetProp<ConfigProviderProps, 'theme'>['token'];
|
|
|
|
const App: React.FC = () => {
|
|
const [radius, setRadius] = useState<number>(0);
|
|
|
|
const token: Partial<AliasToken> = {
|
|
borderRadius: radius,
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<Slider min={0} max={20} style={{ margin: 16 }} onChange={setRadius} />
|
|
<ConfigProvider theme={{ token }}>
|
|
<FloatButton shape="square" badge={{ dot: true }} />
|
|
</ConfigProvider>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default App;
|