Visitar URL original
USWDS - Bug: Accessibility - Multiple unnamed banner landmarks · Issue #2226 · uswds/uswds-site · GitHub
Skip to content

USWDS - Bug: Accessibility - Multiple unnamed banner landmarks #2226

Description

@jaredcunha

Describe the bug

Both the Banner and Header components contain <header> elements, which show up in the rotor as banner landmark. It might not be clear to users with screen readers the difference between the two banner regions.

Steps to reproduce the bug

  1. Got to the USWDS homepage
  2. Turn of VoiceOver
  3. Pull up the rotor menu (VO+U)
  4. Use the arrow keys to pull up the Landmarks
  5. Notice two unnamed banners.

Expected Behavior

One or or both of the components container a banner region should have an accessible name.

Related code

No response

Screenshots

Screenshot 2023-08-02 at 7 23 40 PM

System setup

  • Current USWDS
  • MacOS
  • VoiceOver

Additional context

Some additional can be found in Scott O'Hara's article on landmarks.

Since there is no native “banner element” in HTML, modern browsers are meant to treat the <header>, that is the nearest direct child of the <body> element, as a banner landmark. While there can be multiple <header> elements used within a web document, ideally there should only be a single banner landmark exposed. Instances where multiple banners may be desired would be if there were nested document or application roles within a single view. In such a case, it would be best to ensure each of these were given their own accessible name, as this would allow assistive technologies to jump to each nested banner and have a better idea of which “banner” they had navigated to.

Code of Conduct

Activity

  1. added
    Needs: ConfirmationReported behavior needs validation. Remove after recording reproduction or investigation results.
    Type: BugCompatibility label; native Bug type is authoritative. Retained for templates/search links.
    on Aug 2, 2023
  2. added
    Status: TriageLegacy intake label used by templates. Project Status is authoritative; avoid manual duplication.
    on Aug 2, 2023
  3. transferred this issue fromuswds/uswdson Aug 3, 2023
  4. mejiaj commented on Aug 3, 2023

    @mejiaj
    Contributor

    Thanks for reporting this issue! This seems specific to the site documentation because:

    1. Current USWDS header & banner components don't have role="banner".
    2. Header guidance is outdated and mentions role="banner" - header accessibility guidance.
      image

    The role was removed in uswds/uswds#3104 as part of release 2.2.0.

  5. added
    Affects: Accessibility 🟡Affects access for disabled users or assistive tech. Record the barrier; not a severity score.
    on Aug 3, 2023
  6. moved this to Ready to Schedule in USWDS Core Project Dataon Aug 3, 2023
  7. removed
    Status: TriageLegacy intake label used by templates. Project Status is authoritative; avoid manual duplication.
    on Aug 3, 2023
  8. jaredcunha commented on Aug 3, 2023

    @jaredcunha
    ContributorAuthor

    @mejiaj Ah yeah, probably could could have clarified. Yes, the role attributes are not necessary since that's inherit in the <header> element.

    What I was going to suggest was something like this for Banner component:

    <header class="usa-banner__header">

    Change to:

    <header class="usa-banner__header" aria-label="U.S. Government">

    This way, the landmark in the rotor appears as "U.S. Government banner" instead of "banner." Then perhaps some equivalent for the main site header, like the name of the website. This way it's easier to distinguish between the two elements. Updating the component code snippets to include the aria-label could help.

    Here's a couple screenshots of other sites I've noticed with multiple banners that are not named.

    Screenshot 2023-08-03 at 10 17 06 AM Screenshot 2023-08-03 at 10 18 42 AM Screenshot 2023-08-03 at 10 20 58 AM
  9. amyleadem commented on Aug 3, 2023

    @amyleadem
    Contributor

    Thanks for flagging this @jaredcunha . I was able to confirm that the site has two generic banner landmarks in VoiceOver as shown in the issue writeup.

    Possible next steps

    We should review our uswds-site code to confirm that it is up-to-date and provides a helpful screen reader experience:

    1. Remove the banner role from the header in the site template
    2. Compare the markup in the banner and header components in the site template with the current implementations in USWDS 3.5.0. Update if there are any differences.
    3. Provide more detail about banner type by adding an aria-label (or equivalent) to the <header> elements in banner and header.
    4. Remove guidance about adding role="banner" from the header component page
      1. Note: We have an open PR (USWDS-Site: Fix component pages from audit (Phase 2) #2162) currently in review that removes this guidance.
    5. Consider improving the screen reader navigation experience by removing the commas in the aria labels for identifier and banner (Ex: aria-label="Agency identifier,,,,," ). (In VoiceOver, the commas cause the name to be repeated several times)

    Additionally, if we pursue adding an aria-label to the <header> elements on site, we should consider also doing the same to the components in USWDS and add guidance so this issue isn’t replicated across agency sites.

  10. added
    Role: DevDev expertise is relevant. Project Active Role tracks ownership; this label is not an assignment.
    and removed
    Needs: ConfirmationReported behavior needs validation. Remove after recording reproduction or investigation results.
    on Aug 3, 2023
  11. mejiaj commented on Aug 3, 2023

    @mejiaj
    Contributor

    @jaredcunha thanks for the follow-up information. I saw that the site had older markup and perhaps was too hasty in moving it here.


    @amyleadem thanks for outlining those next steps. Once we go through confirmation we should create GH issues to track them.

  12. removed
    Type: BugCompatibility label; native Bug type is authoritative. Retained for templates/search links.
    Role: DevDev expertise is relevant. Project Active Role tracks ownership; this label is not an assignment.
    on Feb 6, 2025
  13. moved this from Ready to Schedule to In progress in USWDS Core Project Dataon Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Affects: Accessibility 🟡Affects access for disabled users or assistive tech. Record the barrier; not a severity score.Affects: GuidanceRelates to guidance

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions