Normally Pleasant Mixture

    @uiw/react-color-sketch
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.12 • Public • Published

    React Color Sketch

    npm bundle size npm version Open in unpkg

    Sketch Component is a subcomponent of @react-color.

    react-color-sketch

    Install

    npm i @uiw/react-color-sketch

    Usage

    import Sketch from '@uiw/react-color-sketch';
    
    function Demo() {
      const [hex, setHex] = useState("#fff");
      return (
        <Sketch
          style={{ marginLeft: 20 }}
          color={hex}
          onChange={(color) => {
            setHex(color.hex);
          }}
        />
      );
    }

    Props

    import React from 'react';
    import { HsvaColor, ColorResult } from '@uiw/color-convert';
    import { SwatchPresetColor } from '@uiw/react-color-swatch';
    export interface SketchProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'color'> {
      prefixCls?: string;
      width?: number;
      color?: string | HsvaColor;
      presetColors?: false | SwatchPresetColor[];
      editableDisable?: boolean;
      onChange?: (newShade: ColorResult) => void;
    }

    License

    Licensed under the MIT License.

    Install

    npm i @uiw/react-color-sketch

    DownloadsWeekly Downloads

    1,162

    Version

    1.0.12

    License

    MIT

    Unpacked Size

    47 kB

    Total Files

    9

    Last publish

    Collaborators

    • wcjiang