Getting started
A React library that allows inline editing on HTML5 input components
- Supports
input
(most types, even inputs withdatalist
),textarea
andselect
HTML types - Validates user input via a user-defined validation function
- 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
$ yarn add react-easy-edit
... and that's it, you are ready to go.
React-easy-edit supports most html input types like
text
, number
, color
, date
, datetime-local
,time
, month
, week
, radio
, email
, checkbox
,range
,datalist
as well as textarea
and select
import React, { Component } from 'react';
import EasyEdit, {Types} from 'react-easy-edit';
function App() {
const save = (value) => {console.log(value)}
const cancel = () => {console.log("Cancelled")}
return (
<EasyEdit
type={Types.TEXT}
onSave={save}
onCancel={cancel}
saveButtonLabel="Save Me"
cancelButtonLabel="Cancel Me"
attributes={{ name: "awesome-input", id: 1}}
instructions="Star this repo!"
/>
);
}
Last modified 21d ago