1.0.1 • Published 1 year ago

@wellbees/color-picker-input v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Color Picker Input (cpi)

MIT License

Color picker library for React (default react or mui compatible)

Installation

  npm install @wellbees/color-picker-input

Usage/Examples

For React:

import { useState } from 'react'
import { ColorPicker } from '@wellbees/color-picker-input'

function App() {
  const [colorValue, setColorValue] = useState('')
  
  return <ColorPicker 
            value={colorValue}
            inputType="input"
            onChange={(color)=> setColorValue(color)} 
          />
}

For @mui (v5):

import { useState } from 'react'
import { ColorPicker } from '@wellbees/color-picker-input'

function App() {
  const [colorValue, setColorValue] = useState('')

  return <ColorPicker 
            value={colorValue}
            inputType="mui"
            onChange={(color)=> setColorValue(color)} 
          />
}

Ekran Görüntüleri

Uygulama Ekran Görüntüsü

Props

NameTypeDefaultDescription
colorShowTypecircle | squaresquareColor representation shape in the input area
pickerTypechrome | twitter | githubchromePicker representation shape
specialColorsString[][]Used to define fixed colors in selectors. Available on Github and Twitter Selectors. Exam: ["#ff6961","#ffb480","#f8f38d","#42d6a4","#08cad1","#59adf6","#9d94ff","#c780e8"]
inputTypeinput | muiinputUsed to define ui type
variantfilled | outlinedoutlinedUsed to define variant
sizesmall | mediummediumUsed to define input padding
classNameStringUsed to define class
autoFocusBooleanfalseUsed to input focus
valueStringThe value for component
disabledBooleanfalseUsed to input disable
errorBooleanfalseUsed for red warning in case of error
helperTextStringUsed for helper text
fullWidthBooleanfalseUsed to cover the full width of the container
idStringUser to input id
nameStringUsed to input name
labelStringUsed to input label
placeholderStringUsed to input placeholder
requiredBooleanfalseUsed to define input require
onFocusFunctionExam: function(e) => void
onBlurFunctionExam: function(e) => void
onClickFunctionExam: function(e) => void
onChangeFunctionExam: function(color) => void

Features

  • Three Different Picker
  • Live Color Preview
  • Default React and Mui (v5) compatible

Min React Version

React: 17.0.1

Packages Used

react-color, mui, style-sheet, prop-types

Feedback

If you have any feedback, please contact us at tech@wellbees.co.

Authors