VisuallyHidden
Hides content visually but keeps it in the accessibility tree. Use it to give an icon-only control a text name, or to name a region with a heading that takes up no space. It reuses the ts sr-only utility.
Helpers · TaishoDS Core, in plain HTML.
Examples
One working example per case. Each example is the HTML of its preview—copy it as is, and with Core’s CSS and JS loaded, it looks and works the same.
Text for screen readers only
This text is visible.And only a screen reader reads this one.
When to use
- There’s information the layout conveys visually that screen readers don’t get.
- You want to name a region with a heading that won’t be shown.
- Some context text helps explain a control outside its visual placement.
When not to use
- You just want to hide something temporarily. That’s
display: none, which does remove it from the tree. - The information is useful to everyone. Show it.
Do
- Use it to complete what the interface conveys only through position or color.
Don’t
- Don’t hide SEO text or content everyone should read in it.
- Don’t use it to paper over a design problem. If something isn’t clear, fix the design.
TaishoDS Core
Doesn’t need JavaScript—it’s markup and CSS.
Only the CSS that visually hides content while keeping it accessible.
From the CDN, without a build, this component has no file of its own—it comes with taisho.base.css.
For how Core works in general, see Behavior.
Accessibility
- Hides content visually without removing it from the accessibility tree. It’s the primitive for text only the screen reader should read.
Verification
What was actually tested. Anything that wasn’t tested says so—we’d rather say “not verified” than claim too much.
- axe WCAG 2.2 A + AA in a real browser, in light and dark mode, before every release.
- keyboard Adds no keys of its own—it uses the browser’s native behavior.
- screen reader Not verified with a screen reader. Test it in your own combination of components, not just here, where each one appears alone and on its happy path.