Skip to main content

WordCountController

Purpose​

Add a visual count of the number of words in a textarea/string input, with a option for highlighting min/max words.

Actions​

ActionPurpose
--

Targets​

TargetPurposeDefault
inputThe <input> or <textarea> to count words on-
outputThe place where the word count will be output-

Classes​

ClassPurposeDefault
error (Optional)The class to apply if the user does not meet the min/max words (if specified)-

Values​

ValueTypeDescriptionDefault
minNumberThe minimum number of words. This will add an error class (See: Classes) to the input if the min words are not met0
maxNumberThe maximum number of words. This will add an error class (See: Classes) to the input if the max words are exceeded99,999

Events​

EventWhenDispatched onevent.detail
----

Side Effects​

The controller will add an event listener for input to the input target.

How to Use​