Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
react-textarea-count
Advanced tools
Simple textarea chars counter for React
npm i react-textarea-count -S
This is a dead simple plugin to count textareas length with ease. By default a textarea is rendered wrapped inside a .textarea__wrapper
container. Inside of this resides the textarea itself and a span element with class .textarea__count
with the text's length:
<Textarea />
and output:
<div class="textarea__wrapper">
<textarea />
<span class="textarea__count">0</span>
</div>
If you want to show a limit then you have to pass a countLimit
prop so it can become visible:
<Textarea countLimit={10} />
and output:
<div class="textarea__wrapper">
<textarea />
<span class="textarea__count">0/10</span>
</div>
Since countLimit
is passed then everytime the length is bigger than that limit a textarea__count--error
class is applied to the counter. That way you can style it at while:
<div class="textarea__wrapper">
<textarea />
<span class="textarea__count textarea__count--error">11/10</span>
</div>
If you want to hide the counter in a specific case you can use prop countShow
and set it to false:
<Textarea countLimit={10} countShow={...somelogic here} />
and output:
<div class="textarea__wrapper">
<textarea />
</div>
Property | Type | Default | Description |
---|---|---|---|
countLimit | number | 0 | Chars limit. It is optional and if it is not used then chars limit is not shown |
countShow | bool | true | Just in case you want to hide the counter you can set this to false |
This project is licensed under the MIT License
FAQs
Simple textarea chars counter for React
The npm package react-textarea-count receives a total of 4 weekly downloads. As such, react-textarea-count popularity was classified as not popular.
We found that react-textarea-count demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.