mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +08:00
12 lines
364 B
TypeScript
12 lines
364 B
TypeScript
import { ColorPicker, theme } from 'antd';
|
|
import type { Color } from 'antd/es/color-picker';
|
|
import React, { useState } from 'react';
|
|
|
|
const Demo: React.FC = () => {
|
|
const { token } = theme.useToken();
|
|
const [color, setColor] = useState<Color | string>(token.colorPrimary);
|
|
return <ColorPicker value={color} onChange={setColor} />;
|
|
};
|
|
|
|
export default Demo;
|