mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 20:19:44 +08:00
2cdf586291
* chore: fix lint * chore: fix lint * test: fix 16 * fix: lint
29 lines
680 B
TypeScript
29 lines
680 B
TypeScript
import { DownOutlined } from '@ant-design/icons';
|
|
import React, { useState } from 'react';
|
|
import { ColorPicker, Space } from 'antd';
|
|
|
|
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>
|
|
);
|
|
};
|
|
|
|
export default Demo;
|