🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

zeno-edit-text

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zeno-edit-text

Simple editable text component for React

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

React Edit Text

Quality Gate Status travis npm npm

This is an easy-to-use editable text component for React. Simply click on the textbox to edit!

Made with ❤️ by Brian Min

demo

Demo

Please visit https://brianmin.com/react-edit-text/ for a live demo and various examples.

Install

npm install react-edit-text --save

Type definitions

npm install @types/react-edit-text --save-dev

Usage

Make sure to import the CSS stylesheet before using the component.

import React from 'react';

import { EditText, EditTextarea } from 'react-edit-text';
import 'react-edit-text/dist/index.css';

export default function Example() {
  return (
    <div>
      <EditText showEditButton />
      <EditTextarea />
    </div>
  );
}

Props

Shared props

PropTypeRequiredDefaultDescription
idstringNoHTML DOM id attribute
namestringNoHTML input name attribute
classNamestringNoHTML class attribute for the display component
inputClassNamestringNoHTML class attribute for the input component
valuestringNoValue of the component
defaultValuestringNoDefault value of the component
placeholderstringNo''Placeholder value
formatDisplayTextfunctionNo(x) => xCallback function applied on the value to display the formatted value
onSavefunctionNoCallback function triggered when input is saved
onChangefunctionNoCallback function triggered when input is changed
onEditModefunctionNoCallback function triggered when component is clicked
onBlurfunctionNoCallback function triggered when input is blurred
styleobjectNoSets CSS style of input and view component
readonlyboolNofalseDisables the input and only displays the view component

EditText props

PropTypeRequiredDefaultDescription
typestringNo'text'HTML DOM input text type
inlineboolNofalseSets inline display
showEditButtonboolNofalseDisplays an edit button that can be pressed to enable edit mode
editButtonContentnodeNoeditIconSets the content for the edit button. This can be any valid element
editButtonPropsobjectNo{}Sets the props passed to the edit button. This can be any valid DOM attribute

EditTextarea props

PropTypeRequiredDefaultDescription
rowsnumber | 'auto'No3Number of visible rows

Contributing

Contributions are very much appreciated and welcome. Please refer to the contributing guidelines for more details.

License

MIT © Brian Min

Keywords

react

FAQs

Package last updated on 28 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts