Skip to content

Accessibility ​

Having some sort of readable text is important for accessibility, whether it be visually hidden or in a title attribute.

There are two css classes that can be used to add text for screen readers: sr-text or sr-only

Example usage:

html
<a href="#" class="icon-edit"><span class="sr-text">Edit</span></a>

Icon-only triggers in Vue components ​

sr-text and sr-only are for markup you write yourself. Vue components that render their own icon-only trigger already set an aria-label on it, and aria-label overrides an element's text content — so a hidden span placed inside one of these triggers is never announced. Use the component's own prop instead.

ComponentAccessible nameKeyboard operability
EnTooltiptrigger-labelTrigger is focusable; opens on focus (hover activation), closes on Esc.
EnPopovertrigger-labelTrigger is focusable; opens on Enter (or on focus with hover activation), closes on Esc.

Set trigger-label to describe what the tooltip or popover explains — "About pending changes" rather than "Info" — since the icon itself carries no text for a screen reader to announce. Neither component needs tabindex, role, or trigger-event attributes added by hand; see EnPopover's accessibility notes for what the components already provide.