1.0.2 • Published 4 years ago

react-inline-input v1.0.2

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

react-inline-input

An inline editable input component for React.

Displays as text and becomes editable by clicking or tapping.

Example

You can read how it was built here

Installation

npm install react-inline-input

Browser

<script type="text/javascript" src="https://unpkg.com/react-inline-input"></script>

Module

import InlineInput from 'react-inline-input';

Usage

Once installed, it can be used in a template as:

<InlineInput onInput={...} onBlur={...} ... />

See the props table below for the available options.

Props

PropertyTypeDescriptionDefault
onBlurfunctionCalled when the input element has lost focusnull
onInputfunctionCalled when the input value (or selection if type is 'select') changesnull
typestringThe input type. Could be text, number, textarea or selecttext
placeholderstringText to be shown as a placeholder while there is no inputempty string
labelClassesstringCSS classes for the label elementempty string
inputClassesstringCSS classes for the input elementempty string
rowsintegerTextarea rows2
colsintegerTextarea columns20
optionsarrayProvides the options for selects. Each object should have the format {label: x, value: x}[]

License

MIT