JSPM

  • Created
  • Published
  • Downloads 75619
  • Score
    100M100P100Q173846F
  • License MIT

Color hue

Package Exports

  • @uiw/react-color-hue

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@uiw/react-color-hue) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

React Color Hue

npm bundle size npm version Open in unpkg

image

Install

npm i @uiw/react-color-hue

Usage

import Hue from '@uiw/react-color-hue';

function Demo() {
  const [hsva, setHsva] = useState({ h: 0, s: 0, v: 68, a: 1 });
  return (
    <Hue
      hue={hsva.h}
      onChange={(newHue) => {
        setHsva({ ...hsva, ...newHue });
      }}
    />
  );
}

Props

import { AlphaProps } from '@uiw/react-color-alpha';

interface HueProps extends Omit<AlphaProps, 'hsva' | 'onChange'> {
  onChange?: (newHue: { h: number }) => void;
  hue: number;
}

License

Licensed under the MIT License.