Is there a character counter or limit feature ? #4473
-
Hi, I was wondering Plate has a built-in character counter/limit feature? |
Beta Was this translation helpful? Give feedback.
Answered by
felixfeng33
Jul 10, 2025
Replies: 1 comment 1 reply
-
you can get word count by this way. then set to readonly when reach the limit export function getEditorWordCount(editor: SlateEditor) {
const text = editor.api.string([]);
return text ? text.trim().split(/\s+/).filter(Boolean).length : 0;
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
zbeyens
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can get word count by this way. then set to readonly when reach the limit