@govuk-frederic/countdown-text-area

TextArea which accepts a maxlength prop and renders a TextAreaField, limits characters and styles accordingly.

Stats

StarsIssuesVersionUpdatedCreatedSize
@govuk-frederic/countdown-text-area
0.2.03 years ago3 years agoMinified + gzip package size for @govuk-frederic/countdown-text-area in KB

Readme

CountdownTextArea

Import

  import CountdownTextArea from '@govuk-frederic/countdown-text-area';

Usage

Simple

import manageState from 'manage-state';

const ManagedCountdownTextarea = manageState(CountdownTextArea, {
 changeEvent: true,
 propsToState: ['value'],
});

<ManagedCountdownTextarea />

With maxlength (150)

import manageState from 'manage-state';

const ManagedCountdownTextarea = manageState(CountdownTextArea, {
 changeEvent: true,
 propsToState: ['value'],
});

<ManagedCountdownTextarea noMaxLengthAttr maxLength={150} />

With maxlength (100) and positiveOnly

import manageState from 'manage-state';

const ManagedCountdownTextarea = manageState(CountdownTextArea, {
 changeEvent: true,
 propsToState: ['value'],
});

<ManagedCountdownTextarea maxLength={100} positiveOnly />

Properties

Prop Required Default Type Description
maxLength undefined number
noMaxLengthAttr false bool
positiveOnly false bool

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.