Skip to content

docs(tags): update a11y docs #5676

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

docs(tags): update a11y docs #5676

wants to merge 3 commits into from

Conversation

cdransf
Copy link
Member

@cdransf cdransf commented Aug 6, 2025

Description

Improving the accessibility documentation of components.

Related issue(s)

SWC-416

Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

Copy link

changeset-bot bot commented Aug 6, 2025

⚠️ No Changeset found

Latest commit: 9ce7536

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cdransf cdransf self-assigned this Aug 6, 2025
Copy link

github-actions bot commented Aug 6, 2025

📚 Branch Preview

🔍 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-5676

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

Copy link

github-actions bot commented Aug 6, 2025

Tachometer results

Currently, no packages are changed by this PR...

@cdransf cdransf marked this pull request as ready for review August 6, 2025 17:31
@cdransf cdransf requested a review from a team as a code owner August 6, 2025 17:31
Comment on lines +95 to +97
`<sp-tags>` is a `role="list"` container that manages a collection of `Tag` elements. It has an `aria-label` attribute that defaults to "Tags".

`<sp-tags>` uses the roving tabindex pattern for efficient keyboard navigation. `Tab` enters the collection, arrow keys navigate between tags, and only deletable tags are focusable. The container provides `role="list"` semantics with each tag as a `role="listitem"` for proper screen reader support.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great but can we extend this a bit and make it more granular for the users? I was thinking can we add Mouse and keyboard interaction sections under Accessibility and add the usage patterns for the same.

**Mouse**
Read-only tags: Do not get mouse functionality besides a mouse cursor on hover and do not have interactive functionality.

**Keyboard**
Read-only tags: Can not be operated by a keyboard and have no interactive functionality.

Copy link
Collaborator

@rise-erpelding rise-erpelding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know Rajdeep has a few comments here, and I added a couple more that I don't consider to be blockers -- looks good to me!

- **Tags**: The container component (`<sp-tags>`) that manages a collection of `Tag` elements.
- **Tag**: The individual tag element (`<sp-tag>`) that represents a single tag. [Read more about the `Tag` component.](/components/tag/)

### Examples
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's anything wrong with the examples as they are right now, but they could be consolidated similar to how other components have been done by using tabs.

Or, honestly, we don't need to show 3 different examples for tags to show no visual, avatar, icon, etc., since that can be covered by the singular tag component, so one single example might be fine.

Not a blocker as far as I'm concerned, just some food for thought!

- **Tags**: The container component (`<sp-tags>`) that manages a collection of `Tag` elements.
- **Tag**: The individual tag element (`<sp-tag>`) that represents a single tag. [Read more about the `Tag` component.](/components/tag/)

### Examples

```html-live
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a preference between html and html-live? I see more html in the components we've already done but am not sure if there's a specific preference.

Copy link
Collaborator

@marissahuysentruyt marissahuysentruyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! For clarity, I think maybe we should add either some headings for the different variant options, but other than that, I only have suggestions!


### Accessibility

`<sp-tags>` is a `role="list"` container that manages a collection of `Tag` elements. It has an `aria-label` attribute that defaults to "Tags".
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to sort of follow Rajdeeps suggestions, what do you think about changing "Tag elements" to "` elements?

- **Tags**: The container component (`<sp-tags>`) that manages a collection of `Tag` elements.
- **Tag**: The individual tag element (`<sp-tag>`) that represents a single tag. [Read more about the `Tag` component.](/components/tag/)

### Examples
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should add any additional headings to like, name the tag variants? Or at least have a heading for "With an image" or "With an icon" something? We could do a set of tabs, too.

Just a thought!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also- should this be "Examples" or "Options?" Looks like the documentation structure has "Options" instead.


`<sp-tags>` is a `role="list"` container that manages a collection of `Tag` elements. It has an `aria-label` attribute that defaults to "Tags".

`<sp-tags>` uses the roving tabindex pattern for efficient keyboard navigation. `Tab` enters the collection, arrow keys navigate between tags, and only deletable tags are focusable. The container provides `role="list"` semantics with each tag as a `role="listitem"` for proper screen reader support.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh oh oh! I was just looking into roving tabindex. Want to link to the documentation?

/tools/roving-tab-index

cdransf and others added 2 commits August 10, 2025 20:29
Co-authored-by: Rajdeep Chandra <[email protected]>
Co-authored-by: Rajdeep Chandra <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants