Skip to content

feat(packages/sui-svg): add role presentation to decorative svgs #1933

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

Merged
merged 1 commit into from
Jun 6, 2025

Conversation

lolarufino
Copy link
Contributor

@lolarufino lolarufino commented Jun 5, 2025

Description

This pull request adds role="presentation" to decorative svgs that already have aria-hidden="true" to improve accessibility compliance and ensure a consistent experience across assistive technologies.

While aria-hidden="true" removes an element and its children from the accessibility tree, effectively hiding it from screen readers, adding role="presentation" serves a complementary purpose:

💚 aria-hidden="true": Completely hides the element and its descendants from assistive technologies.

💚 role="presentation": Removes the semantic meaning of the element but still exposes its content to assistive technologies. This is particularly useful for elements that are purely decorative and do not convey meaningful information.

The SVG is hidden from screen readers (aria-hidden="true").

The SVG does not add any semantic meaning to the accessibility tree (role="presentation").

@andresin87
Copy link
Member

👏

@lolarufino lolarufino merged commit 9f6edfc into master Jun 6, 2025
2 checks passed
@lolarufino lolarufino deleted the add-role-presentation branch June 6, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants