React Edit Text
This is an editable text component for React. Simply click on the text to edit!
Made with ❤️ by Brian Min
Demo
Feel free to check out the live demo
Install
npm install react-edit-text --save
Usage
import React, { Component } from 'react'
import EditText from 'react-edit-text'
import 'react-edit-text/dist/index.css'
class Example extends Component {
render() {
return <EditText name="inputName"></EditText>
}
}
Props
Prop | Type | Required | Default | Note |
---|
id | string | No | | HTML id attribute |
type | string | No | text | HTML input type |
name | string | No | '' | HTML name attribute |
className | string | No | | HTML class attribute |
value | string | No | '' | Value of the input and text content |
placeholder | string | No | '' | Placeholder value |
onSave | function | No | | Callback function triggered when input is saved |
inline | bool | No | false | Sets inline display |
style | object | No | | Sets CSS style of input and text component |
License
MIT © bymi15