@uiw/react-color-editable-input-hsla

Color Editable Input HSLA

Usage no npm install needed!

<script type="module">
  import uiwReactColorEditableInputHsla from 'https://cdn.skypack.dev/@uiw/react-color-editable-input-hsla';
</script>

README

React Color Editable Input HSLA

npm bundle size npm version Open in unpkg

EditableInputHSLA Component is a subcomponent of @react-color.

react-color-editable-input-rgba

Install

npm i @uiw/react-color-editable-input-hsla

Usage

import { useState } from 'react';
import { hsvaToHex } from '@uiw/color-convert';
import EditableInputHSLA from '@uiw/react-color-editable-input-hsla';

function Demo() {
  const [hsva, setHsva] = useState({ h: 209, s: 36, v: 90, a: 1 });
  return (
    <div style={{ padding: '0 10px 0 20px' }}>
      <EditableInputHSLA
        hsva={hsva}
        onChange={(color) => {
          setHsva({ ...hsva, ...color.hsva });
        }}
      />
    </div>
  );
}

Props

import React from 'react';
import { EditableInputRGBAProps } from '@uiw/react-color-editable-input-rgba';
export interface EditableInputHSLAProps extends Omit<EditableInputRGBAProps, 'rProps' | 'gProps' | 'bProps'> {
  hProps?: EditableInputRGBAProps['gProps'];
  sProps?: EditableInputRGBAProps['gProps'];
  lProps?: EditableInputRGBAProps['gProps'];
  aProps?: EditableInputRGBAProps['aProps'];
}

License

Licensed under the MIT License.