schmeits/filament-character-counter
Easy drop-in Filament character counter for TextField, Textarea and RichEditor fields in Filament v4 and v5. Add a characterLimit or maxLength to display a live character count, optionally shown inside the control. Translation strings are publishable, and v3.2 is supported via 1.x.
$set() and form resets, not only on key presses.max: rule..claude/, CLAUDE.md, package-lock.json, stubs/ and more) are no longer included in the Packagist archive.aria-describedby.characters_over translation in every language.shouldShowCharacterCounter(); getShowCharacterCounter() is deprecated.filament/forms and filament/support instead of the whole filament/filament panel package.fi-input-charcounter-exceeded instead of warning.character_seperator is no longer read.declare(strict_types=1) everywhere, PHPStan on the highest level.RichEditor character counting: Completely refactored RichEditor character counter implementation
$el.querySelector('.fi-fo-rich-editor-content') to get text contentHasCharacterLimit trait: Made characterLimit() automatically call maxLength() to enforce HTML maxlength attribute
showCharacterCounter(bool|Closure $condition = true) method to conditionally display the character counter on individual fields (#41, thanks @mediatorviolet)showCharacterCounter() was merged after the v5.0.1 tag and never released, which caused #50. This release ships it via Composer.
Full Changelog: https://github.com/schmeits/filament-character-counter/compare/v5.0.1...v5.1.0
## Fixed
- **characterLimit() is now a soft limit again** (#36): characterLimit() no longer enforces HTML maxlength or validation. Use maxLength() for hard enforcement, or combine both.
- Fixed test suite (removed obsolete BladeCaptureDirective dependency)
- Fixed PHPStan config (removed deprecated options)
RichEditor Character Counting - Complete refactor:
HasCharacterLimit Trait:
Tested and working in:
All components (TextInput, Textarea, RichEditor) working correctly in both versions.
Updated readme
First release Filament 4 version
New : Added French translation (thanks to @tgeorgel)
Fix: The showInsideControl was missing from the Textarea (Thanks @CharlieEtienne for the PR)
Updated:
Changed: Updated README with new RichEditor support
New: Added Arabi clanguage (thanks to Omar @devOMAR-2) New: Added RichEditor support
Fix: Respect maxLength in combination with characterLimit
fix: typo in translation for the dutch variant of characters
Fixed a bug if you use ->live() on the Fields, the counter would stutter and the character count was not correct.
Added the option to show the counter in the component (default is outside the component)
Fix: Placed helper in correct section
First release of the package
How can I help you explore Laravel packages today?