Re: Aria on <svg> <g> tags

The short answer is that it can be used, but you should test extensively 
with a range of browsers and screen readers.


The longer answer is that ARIA is not officially supported when SVG is 
the host language. If/when SVG 2.0 becomes a W3C Recommendation, this 
will change, but it's been stalled since 2018, so who knows if/when it 
might happen.

You can use ARIA with SVG in practice though. A simple <g 
role="button">Accessible Name Here</g> will work in most cases (with the 
appropriate functionality attached to it), but the more complex the 
surrounding SVG the less robust the pattern.



On 16/08/2023 12:08, Ms J wrote:
> Hello
> 
> If there is an interactive svg with <g> tags made into interactive 
> buttons, can aria such as role=button be used on these <g> elements? Is 
> that legitimate mark-up? I can't find any resources on this.
> 
> Thanks
> 
> Sarah
> 
> Sent from Outlook for iOS <https://aka.ms/o0ukef>

-- 
Léonie Watson (she/her)
Director
https://tetralogical.com

Received on Wednesday, 16 August 2023 11:31:14 UTC