Socket
Socket
Sign inDemoInstall

react-pencil

Package Overview
Dependencies
7
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-pencil

A React component that allows single and multiline in-place edits.


Version published
Weekly downloads
2K
increased by122.97%
Maintainers
1
Install size
891 kB
Created
Weekly downloads
 

Readme

Source

React Pencil

A delicate React component that enables single-line and multi-line in-place edits. Single-line edits are performed on HTML input whereas multi-line edits are performed on content editable spans.

React-pencil works on modern browsers such as Chrome, Firefox, Safari and IE 11+.

Installation

$ npm i react-pencil

Features

  • Single-line in-place edits
  • Multi-line in-place edits
  • Autosized fields
  • Pencil button suffix
  • Placeholders
  • Error display
  • Fully customizable via pass through props
  • OnEditDone callback

Examples

Single-line editing

<ReactPencil name='name' value='John Doe'/>

Multi-line editing

<ReactPencil
  name='bio'
  value='Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...'
  className='bio'
  multiline={true}
/>

Placeholders

Single-line
<ReactPencil
  name='firstname'
  placeholder='Type your firstname here...'
/>
Multi-line
<ReactPencil
  name='firstname'
  multiline={true}
  placeholder='Type your bio here...'
/>

Error display

<ReactPencil
  name='email'
  value='@example.com'
  error='Invalid email address'
/>

Callbacks

<ReactPencil value='John Doe' onEditDone={this.onEditDone}/>

Future expansions

  • Client side validation
  • Support for legacy browsers

Licence

MIT

Keywords

FAQs

Last updated on 07 Nov 2017

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc