JSPM

  • Created
  • Published
  • Downloads 41472
  • Score
    100M100P100Q173537F
  • License MIT

Color ShadeSlider component for React.

Package Exports

  • @uiw/react-color-shade-slider
  • @uiw/react-color-shade-slider/cjs/index.js
  • @uiw/react-color-shade-slider/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-shade-slider) 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 Shade Slider

npm bundle size npm version Open in unpkg

ShadeSlider Component is a subcomponent of @react-color.

react-color-shade-slider

Install

npm i @uiw/react-color-shade-slider

Usage

import React, { useState } from 'react';
import ShadeSlider from '@uiw/react-color-shade-slider';

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

Props

import React from 'react';
import { AlphaProps } from '@uiw/react-color-alpha';
export interface ShadeSliderProps extends Omit<AlphaProps, 'onChange'> {
  onChange?: (newShade: {
    v: number;
  }) => void;
}
declare const ShadeSlider: React.ForwardRefExoticComponent<ShadeSliderProps & React.RefAttributes<HTMLDivElement>>;
export default ShadeSlider;

Contributors

As always, thanks to our amazing contributors!

Made with contributors.

License

Licensed under the MIT License.