CharacterCount
Supporting character or remaining-length feedback with an explicit over-limit message.
Preview
Use CharacterCount
CharacterCount is a named export of @flood-md/react. Connect the package once, then import what you use.
Design notes
- Pass text through value or supply an explicit nonnegative integer count for a host-defined counting rule. The default text count uses Unicode code points, not UTF-16 code units or grapheme clusters. max is advisory and does not truncate or validate an editor.
- mode remaining displays max minus count; count displays the current count and optional limit. An over-limit message is visible in addition to its semantic color. Translate label/overLimitLabel; lang formats the number.
- Use htmlFor to associate supporting output with its editor and aria-describedby on the editor when appropriate. Live announcements default off to avoid announcing every keystroke; the host may opt into aria-live. Available in 0.2.5.
API reference
View TypeScript source