Purpose
Add a visual count of the number of characters in a textarea/string input, with an option for highlighting min/max characters.
Target | Purpose | Default |
---|
input | The <input> or <textarea> to count characters on | - |
output | The place where the characters count will be output | - |
Action | Purpose |
---|
error (Optional) | The class to apply if the user does not meet the min/max characters (if specified) |
Value | Type | Description | Default |
---|
min | Number | The minimum number of character. This will add an error class (See: Classes) to the input if the min character are not met | 0 |
max | Number | The maximum number of character. This will add an error class (See: Classes) to the input if the max character 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