Public
Like
datocms-plugin-character-counter-example
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
A DatoCMS plugin that automatically shows a character counter on fields that are configured to have validations on length.
- Automatic activation: The plugin automatically attaches to fields with length validators
- Manual installation: Can also be manually added to fields
- Multiple field types: Supports string, text, and structured_text field types
- Smart counting: For structured text, counts only the actual text content (not markup)
- Single-line string
- Multiple-paragraph text
- Structured text
The plugin uses the overrideFieldExtensions hook to automatically add a character counter addon to fields that:
- Are one of the supported field types (string, text, or structured_text)
- Have length validation configured
- Don't already have the character counter addon installed
The counter displays the current character count in a small, unobtrusive format below the field.
Based on the official DatoCMS character-counter plugin.