react-color-attribute
v1.1.4
Published
React component for product colour attributes
Readme
react-color-attribute
React component for rendering product color attributes.
Installation
Install the package from npm:
npm install --save react-color-attributeUsage
import ColorAttribute from 'react-color-attribute';Props
|Name|Type|Default|Description|
|---|---|---|---|
|colors|string[]|[]|Valid CSS colors to render in attribute component|
|id|string||Unique identifier for the color attribute|
|selected|boolean|false|Determines if the component should render in a selected state|
|onMouseEnter|function||Callback fired when mouse enters componentSignature:function(id: string) => void|
|onMouseLeave|function||Callback fired when mouse leaves componentSignature:function(id: string) => void|
|onClick|function||Callback fired when component is clicked componentSignature:function(id: string) => void|
