ant-design/components/color-picker/demo/base.tsx
红果汁 b95d5674fa
feat: new component ColorPicker (#41990)
* 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>
2023-05-12 14:43:48 +08:00

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} />;
};