0.2.0 • Published 5 years ago

@govuk-frederic/countdown-text-area v0.2.0

Weekly downloads
7
License
MIT
Repository
-
Last release
5 years ago

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

PropRequiredDefaultTypeDescription
maxLengthundefinednumber
noMaxLengthAttrfalsebool
positiveOnlyfalsebool