Purpose
Add a visual count of the number of words in a textarea/string input, with a option for highlighting min/max words.
Target | Purpose | Default |
---|
input | The <input> or <textarea> to count words on | - |
output | The place where the word count will be output | - |
Class | Purpose | Default |
---|
error (Optional) | The class to apply if the user does not meet the min/max words (if specified) | - |
Value | Type | Description | Default |
---|
min | Number | The minimum number of words. This will add an error class (See: Classes) to the input if the min words are not met | 0 |
max | Number | The maximum number of words. This will add an error class (See: Classes) to the input if the max words are exceeded | 99,999 |
Events
Event | When | Dispatched on | event.detail |
---|
- | - | - | - |
Side Effects
The controller will add an event listener for input
to the input
target.
How to Use