0.3.1 • Published 6 years ago

react-text-to-input v0.3.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

react-text-to-input

npm version

React component that switches between a "text view" and an "input view" after a click.

Check the DEMO

How to use

Install

Run yarn add react-text-to-input or npm install react-text-to-input

Use

import TextToInput from "react-text-to-input";

<TextToInput
    value={this.state.value}
    onChange={this.onChange}
/>

By default, the div element in "the view mode" has minHeight set to 20px to prevent the element turning not clickable when value is empty.

Properties

PropertyTypeRequired
valuestringyes
onChange(value\: string) \=> voidyes
textClassNamestringno
inputClassNamestringno
textStyleReact.CSSPropertiesno
inputStyleReact.CSSPropertiesno
inputPropsReact.HTMLPropsno

Running example

cd example/
yarn start
0.3.1

6 years ago

0.3.0

6 years ago

0.2.2

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago