🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

react-textarea-counter

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-textarea-counter

Basic textarea character counter React component.

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

react-textarea-counter

NPM Code Style Build Status

Basic textarea character counter React component.

Installation

npm i react-textarea-counter --save

Usage

import React from 'react';
import TextareaCounter from 'react-textarea-counter';

export default function MyComponent() {
  return <TextareaCounter countLimit={25} initialValue="Hello World!" />;
}

Props

PropertyTypeDefaultDescription
showCountbooltrueIf you want to show the counter or to hide it.
countLimitnumber25The max number of characters on the counter.
countDirectionstringascIf it should count from the countLimit to zero set to desc otherwise set it to asc.
countPositionstringrightPosition of the counter on the bottom of the textarea.
shouldTruncatestringtrueIf you want to allow the user to insert more characters than the countLimit set to false.
initialValuestringThe default initial value on the textarea element.
rowsnumber6The number of rows of the textarea element.
resizestringverticalResize attribute of the textarea element. Can be none, both, horizontal or vertical.
placeholderstringPlaceholder of the textarea element.
onChangefuncCallback function on the onChange event.
onFocusfuncCallback function on the onFocus event.
onBlurfuncCallback function on the onBlur event.
requiredboolfalseRequired attribute of the textarea element.
disabledboolfalseDisabled attribute of the textarea element.

License

Open source under the terms of the MIT License.

Made by Diogo Capela.

Keywords

react

FAQs

Package last updated on 01 Mar 2023

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