2023-06-25 20:44:16 +08:00
|
|
|
import { DownOutlined } from '@ant-design/icons';
|
|
|
|
import React, { useState } from 'react';
|
2023-07-28 16:17:43 +08:00
|
|
|
import { ColorPicker, Space } from 'antd';
|
2023-06-19 19:29:39 +08:00
|
|
|
|
2023-06-25 20:44:16 +08:00
|
|
|
const Demo = () => {
|
|
|
|
const [open, setOpen] = useState(false);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Space direction="vertical">
|
|
|
|
<ColorPicker showText />
|
|
|
|
<ColorPicker showText={(color) => <span>Custom Text ({color.toHexString()})</span>} />
|
|
|
|
<ColorPicker
|
|
|
|
open={open}
|
|
|
|
onOpenChange={setOpen}
|
|
|
|
showText={() => (
|
|
|
|
<DownOutlined
|
|
|
|
rotate={open ? 180 : 0}
|
|
|
|
style={{
|
|
|
|
color: 'rgba(0, 0, 0, 0.25)',
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
/>
|
|
|
|
</Space>
|
|
|
|
);
|
|
|
|
};
|
2023-06-19 19:29:39 +08:00
|
|
|
|
|
|
|
export default Demo;
|