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

2.1.1 • Public • Published

React Color Hue

Buy me a coffee 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.

Package Sidebar

Install

npm i @uiw/react-color-hue

Weekly Downloads

23,627

Version

2.1.1

License

MIT

Unpacked Size

8.41 kB

Total Files

7

Last publish

Collaborators

  • uiwjs
  • wcjiang