-
Notifications
You must be signed in to change notification settings - Fork 5
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
a11y support #2
Comments
First of all, awesome to see you're thinking a11y @joshwcomeau! Since the React Retro Hit Counter is intentionally presentational, with no user action expected, your work for serving a readable version for assistive tech can be pretty simple. For a good, solid start, you'll want to have a textual version of the counter value available in the DOM. This could be as simple as a To visually hide the alternative text, you can use a similar approach to Bootstrap's
Since the counter itself provides no content for non-sighted users and machines, I would even consider employing
If you're looking to mod the counter to change it's value while it is mounted (eg. syncing ongoing traffic while a user is mid-session), you could get into some fun with ARIA's live region options as well. |
Oh wow, awesome. Thanks so much for this trove of info! Sounds pretty straightforward, and about what I expected. While in my own projects I haven't made the counter update after initial render, presumably others who use this project might! Live regions seem really neat! This counter is just presentational, so presumably some folks might want to have it auto-update? I think I'll wait and see if this counter is used anywhere outside my own projects (which don't auto-update). Thanks again for the info :) |
React Retro Hit Counter creates numbers using SVG segments and a canvas border. This is totally unfriendly to screen readers.
I have a few thoughts for how to make it more accessible:
I don't really know what would be best. Open to suggestions!
The text was updated successfully, but these errors were encountered: