JSPM

  • Created
  • Published
  • Downloads 75619
  • Score
    100M100P100Q173846F
  • 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 React, { useState } from 'react';
import Hue from '@uiw/react-color-hue';

export default function Demo() {
  const [hsva, setHsva] = useState({ h: 0, s: 0, v: 68, a: 1 });
  return (
    <Hue
      hue={hsva.h}
      onChange={(newHue) => {
        setHsva({ ...hsva, ...newHue });
      }}
    />
  );
}
import React, { useState } from 'react';
import Hue from '@uiw/react-color-hue';

export default function Demo() {
  return (
    <Hue hue={undefined} />
  );
}

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;
}
declare const Hue: React.ForwardRefExoticComponent<HueProps & React.RefAttributes<HTMLDivElement>>;
export default Hue;

Contributors

As always, thanks to our amazing contributors!

Made with contributors.

License

Licensed under the MIT License.