JSPM

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

Color hue

Package Exports

  • @uiw/react-color-hue
  • @uiw/react-color-hue/cjs/index.js
  • @uiw/react-color-hue/esm/index.js

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

Hue Component is a subcomponent of @react-color.

react-color-hue

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 React from 'react';
import { AlphaProps } from '@uiw/react-color-alpha';
export interface HueProps extends Omit<AlphaProps, 'hsva' | 'onChange'> {
  onChange?: (newHue: { h: number; }) => void;
  hue: number;
}

License

Licensed under the MIT License.