ant-design/components/color-picker/demo/pure-panel.tsx

17 lines
490 B
TypeScript
Raw Normal View History

import React, { useState } from 'react';
import { ColorPicker, theme } from 'antd';
import type { Color } from 'antd/es/color-picker';
const PureRenderColorPicker = ColorPicker._InternalPanelDoNotUseOrYouWillBeFired;
export default () => {
const { token } = theme.useToken();
const [color, setColor] = useState<Color | string>(token.colorPrimary);
2023-05-16 14:18:12 +08:00
return (
<div style={{ paddingLeft: 100 }}>
<PureRenderColorPicker value={color} onChange={setColor} />
</div>
);
};