A React library that allows inline editing on HTML5 input components, try the sandbox here!
For full library documentation, visit this site!
β‘οΈ Want to migrate to v2.0.0? Read our migration guide to v2.0.0 β¬ οΈ
- Supports
input(most types, even inputs withdatalist),textarea,radio,checkbox,tel,urlandselectHTML types - Validates user input
- Allows customisation on all elements including the save and cancel buttons
- Supports custom editComponent and custom displayComponent for each type
npm i react-easy-edit or yarn add react-easy-edit
Give a β if this project helped you in any way!
For the full list of props, please visit our documentation site.
More examples can be found here
import React, { Component } from 'react';
import EasyEdit from 'react-easy-edit';
function App() {
const save = (value) => {alert(value)}
const cancel = () => {alert("Cancelled")}
return (
<EasyEdit
type="text"
onSave={save}
onCancel={cancel}
saveButtonLabel="Save Me"
cancelButtonLabel="Cancel Me"
inputAttributes={{ name: "awesome-input", id: 1}}
instructions="Star this repo!"
/>
);
}<EasyEdit
type="radio"
value="one"
onSave={save}
options={[
{label: 'First option', value: 'one'},
{label: 'Second option', value: 'two'}]}
instructions="Custom instructions"
/><EasyEdit
type="date"
onSave={save}
instructions="Select your date of birth"
/><EasyEdit
type="select"
options={[
{label: 'First option', value: 'one'},
{label: 'Second option', value: 'two'}]}
onSave={save}
placeholder="My Placeholder"
instructions="Custom instructions"
/><EasyEdit type="datalist" options={[ {label: 'First option', value: 'one'}, {label: 'Second option', value: 'two'}]} onSave={save} instructions="Custom instructions" />

