1.0.0 • Published 4 years ago

editable-input-react v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

editable-input-react

Travis npm package Coveralls

editable-label-react is a easy and small component Label that you can edit just by clicking.

how to use:

function Demo() {
  const [text, setText] = useState("Click here to edit.");

  return (
    <div>
      <h1>editable-input-react Demo</h1>
      <EditableLabel
        labelClassName="myLabelClass"
        inputClassName="myInputClass"
        inputWidth="200px"
        inputHeight="25px"
        inputMaxLength="50"
        labelFontWeight="bold"
        inputFontWeight="bold"
        value={text}
        onChange={e => setText(e.target.value)}
        onFocus={t => console.log("focus", t)}
        onFocusOut={t => console.log("focus out", t)}
      />
    </div>
  )
}

see a example here

component api

EventsDescriptionreturn
onChangea normal event of a inputevent object
onFocustrigged when user clicksa string input value
onFocusOuttrigged when user get out focus from component or press enter keya string input value
PropsDescription
labelClassNameclassName for label
labelFontSizesize of label font
labelFontWeightweight of label font
labelPlaceHolderplaceholder of label
inputClassNameclassName for input
inputMaxLengthmax length of input
inputPlaceHolderplaceholder of input
inputTabIndextabIndex of input
inputWidthwidth of input
inputHeightheight of input
inputFontSizefont size of input
inputFontWeightfont weigth of input
inputBorderWidthborder width of input

other props is loading in the next verions...