1.0.5 • Published 5 years ago

@hbtv/color-picker v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

@hbtv/color-picker

安装方法

yarn add @hbtv/color-picker

使用方法

import React,{ useState } from 'react'; 
import ColorPicker from './index';

const Usage = () => {
  const [color, setColor] = useState('transparent');
  return (
    <div>
     选择颜色:<ColorPicker value={color} onChange={setColor} />
    </div>
  );
}

export default Usage;
export interface ColorPickerProps {
  output?: 'hex' | 'rgba'; // 输出颜色 模式 #fff 或 rgba(107,48,48,0.6)
  mode?: 'simple' | 'complex'; // 调色板颜色
  placement?: 'left' | 'right' | 'top' | 'bottom'; // 提示框位置 默认bottom
  style?: CSSProperties; // 样式
  showInput?: boolean; // 显示输入框 默认 true
  value?: string; // 颜色值
  onChange?: (value: string) => void; // onChange 事件
}
1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago