mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-16 01:41:02 +08:00
b95d5674fa
* feat: color picker * chore: improve component logic * test: update snapshots * test: update snapshots * fix: remove unuse code * fix: adjusting the UI * fix: hairy edge in dark mode * fix: demo case * chore: rollback file * fix: improve code logic * perf: improve code * test: add test case * refactor: trigger use Popover instead * test: add test case * refactor: improve code logic * test: update snapshots * refactor: improve code * docs: add overview img * feat: style * chore: update snapshot * chore: code clean * chore: code clean * chore: fix lint * chore: update snapshot * feat: color block * chore: pure render * refactor: hex input number reduced to 6 digits * fix: rename React to react * refactor: trigger demo * docs: remove disabled demo --------- Co-authored-by: MadCcc <1075746765@qq.com>
11 lines
336 B
TypeScript
11 lines
336 B
TypeScript
import { ColorPicker, theme } from 'antd';
|
|
import type { Color } from 'antd/lib/color-picker';
|
|
import React, { useState } from 'react';
|
|
|
|
export default () => {
|
|
const { token } = theme.useToken();
|
|
const [color, setColor] = useState<Color | string>(token.colorPrimary);
|
|
|
|
return <ColorPicker value={color} onChange={setColor} />;
|
|
};
|