Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Character count component, show character and word count for content field #697

Merged
merged 2 commits into from
Feb 23, 2024

Conversation

paulrobertlloyd
Copy link
Collaborator

Based on the Character count component from the GOV.UK Design System.

The <character-count> component provides a visible, real-time character and word count for a <textarea> as well as a visually hidden counter that announces updates to screen readers periodically. Some more background surrounding this approach can be found in this blog post by David Cox.

Unlike the GOV.UK example, this component provides only a character and word count, and doesn’t inform or enforce any limits. Different social networks will have different limits, so a character count only needs to be informative. This component is also currently shown when writing longer article posts, and whilst here there are no limits, it's nice to know how many words you’ve written.

The counter is translated, of course.

Screenshot of the counter component. Screenshot of the counter component with a German translation.

@paulrobertlloyd paulrobertlloyd added enhancement New feature or request plugin-endpoint Endpoint plug-in frontend labels Feb 23, 2024
@paulrobertlloyd paulrobertlloyd added this to the v1.0 milestone Feb 23, 2024
@paulrobertlloyd paulrobertlloyd merged commit ba769f9 into main Feb 23, 2024
1 check passed
@paulrobertlloyd paulrobertlloyd deleted the feat/character-count branch February 23, 2024 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend plugin-endpoint Endpoint plug-in
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant