[
    {
        "role": "user",
        "content": "from%20an%20accessibility%20perspective%2C%20when%20a%20screen%20reader%20user%20is%20interacting%20with%20a%20tablist%20component%2C%20should%20the%20various%20tabs%20in%20the%20tablist%20also%20be%20announced%20as%20links%3F"
    },
    {
        "role": "assistant",
        "content": "No \u2014 tabs in a `tablist` component *should not* be announced as links by screen readers if they're implemented correctly using ARIA and/or semantic HTML. They should be announced as \u201ctabs,\u201d with state information (e.g. \u201cselected\u201d or \u201cnot selected\u201d), and their position in the set (e.g. \u201ctab 2 of 4\u201d). Here\u2019s why, per accepted accessibility standards:\n\n---\n\n## What ARIA / WCAG Say\n\n- **Role definitions**: The ARIA spec defines specific roles for tabbed interfaces. A container wrapping tabs should have role `tablist`, and each tab should have role `tab`. The content sections controlled by tabs should have role `tabpanel`. This explicitly distinguishes them from links. ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/tab_role?utm_source=openai))\n\n- **Tab behaviour & semantics**: The `role=\"tab\"` signals to assistive technologies that this element behaves as a tab\u2014it activates or switches content panels\u2014not that it navigates to a different resource like a link would. Thus the screen reader announces it as a tab, not a link. ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/tab_role?utm_source=openai))\n\n- **Unsupported use of interactive children inside tablist**: Tablist should not contain \u201cforbidden interactive children such as links or buttons\u201d unless they also have the `role=\"tab\"` role explicitly. This avoids confusion where, for example, a link inside a tablist might be mistaken for a tab itself. ([knowledge.evinced.com](https://knowledge.evinced.com/components/tablist/?utm_source=openai))\n\n---\n\n## What Users Will Hear with a Proper Tab Implementation\n\nIf tabs are implemented correctly:\n\n- The user will hear something like: **\u201cSettings, tab, 2 of 4, selected\u201d**.\n- If a tab is not selected: **\u201cProfile, tab, 3 of 4\u201d**.\n- Pressing arrow keys moves focus between tabs. Enter or Space activates one. ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/tab_role?utm_source=openai))\n\nThey **should not** hear \u201clink\u201d in these descriptions, because link implies navigation to another resource (or another page), which is semantically very different.\n\n---\n\n## What Happens When Tabs Are Mis-Implemented\n\nIf you use an `<a>` tag (link) inside the tablist without overriding its semantics, or fail to apply `role=\"tab\"`, then:\n\n- The screen reader will likely announce it as a link (e.g. \u201clink: Profile\u201d).\n- The user might expect navigation to a different document or page, which can cause confusion.\n- Keyboard behavior might also seem inconsistent: links are activated differently than tabs, which can break expectations and accessibility. \n\nEven if you wrap the tab inside an `<a href=\"...\">` tag purely to mimic semantics, you should **still** apply `role=\"tab\"` (or use a `<button role=\"tab\">`) and ensure keyboard and ARIA attributes behave like a tab control. But just using a native anchor tag generally misleads the user into thinking it\u2019s a link. ([aria-roles.info](https://aria-roles.info/role/tab.html?utm_source=openai))\n\n---\n\n## Best Practices to Ensure Screen Readers Announce Tabs Correctly\n\nHere are things you should do to make sure tabs are correctly announced:\n\n- Each tab element should have `role=\"tab\"`; container should be `role=\"tablist\"`. ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/tab_role?utm_source=openai))  \n- Use `aria-controls` on each tab to link to its associated `tabpanel`. ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/tab_role?utm_source=openai))  \n- Use `aria-selected=\"true\"` on the active tab; `false` on inactive ones. ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/tab_role?utm_source=openai))  \n- Manage `tabindex`: only the active tab is typically in the tab order (`tabindex=\"0\"`); others get `tabindex=\"-1\"` so arrow keys move focus between them. ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/tab_role?utm_source=openai))  \n- If using native HTML elements: `<button role=\"tab\">` is often better than using `<a>` or `<div>`, because `button` has built-in interactive behavior and roles. But if you use an `<a>`, override semantics properly. ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/tab_role?utm_source=openai))  \n- Label each tab clearly (visible label or aria-label / aria-labelledby). Users should hear \u201ctab [label]\u201d. ([knowledge.evinced.com](https://knowledge.evinced.com/components/tablist/?utm_source=openai))\n\n---\n\n## Summary\n\nFrom an accessibility standpoint:\n\n- **No**, tabs should *not* be announced as links when implemented properly.\n- They should be announced as *tabs*, with the appropriate `role=\"tab\"` and correct ARIA attributes.\n- Using links without adjusting semantics typically results in incorrect announcements and a confusing experience for screen reader users.\n\nIf you\u2019d like, I can show you example code snippets or behavior comparisons (proper vs. mis-implemented) so you can hear what different screen readers do in each case."
    },
    {
        "role": "user",
        "content": "when%20a%20screen%20reader%20user%20is%20navigating%20inside%20a%20tablist%2C%20should%20this%20be%20done%20with%20the%20left%2Fright%20arrow%20keys%3F%20or%20the%20up%2Fdown%20arrow%20keys%3F"
    },
    {
        "role": "assistant",
        "content": "When a screen reader user is navigating within a `tablist` component, which arrow keys to use (left/right or up/down) depends on how the tablist is oriented. Here\u2019s a detailed look at the standards and best practices:\n\n---\n\n## Orientation Matters\n\nThe **ARIA Authoring Practices** (APG) define two types of tablist orientations:\n\n- **Horizontal tablist**: Tabs are laid out side-by-side, typically across the top.  \n- **Vertical tablist**: Tabs are stacked top-to-bottom, such as in a sidebar. ([playground.halfaccessible.com](https://playground.halfaccessible.com/aria-reference/aria-orientation-attribute?utm_source=openai))\n\nThe orientation should be explicitly declared using the `aria-orientation` attribute:\n\n- Set `aria-orientation=\"horizontal\"` for horizontal tablists (this is the default if the attribute is omitted) ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-orientation?utm_source=openai))  \n- Set `aria-orientation=\"vertical\"` for vertical tablists ([knowledge.evinced.com](https://knowledge.evinced.com/components/Tablist?utm_source=openai))\n\n---\n\n## Which Arrow Keys Are Used\n\nDepending on the orientation:\n\n- **Horizontal Tablist** (default orientation):  \n  Use **Left Arrow** and **Right Arrow** keys to move focus (and optionally activate) between tabs. Up and Down arrows should *generally * *not* be hijacked by the tablist, so they can keep their usual scrolling behavior in browsers. ([knowledge.evinced.com](https://knowledge.evinced.com/components/Tablist?utm_source=openai))\n\n- **Vertical Tablist**:  \n  Use **Up Arrow** and **Down Arrow** to navigate between tabs. Left/Right arrows should *not* override their usual behavior in this case. ([playground.halfaccessible.com](https://playground.halfaccessible.com/aria-reference/aria-orientation-attribute?utm_source=openai))\n\nAPG\u2019s keyboard interaction pattern: \u201cIf the tab list is vertical, the Up arrow performs as Left arrow, Down as Right arrow.\u201d ([w3.org](https://www.w3.org/TR/2018/WD-wai-aria-practices-1.2-20181218/?utm_source=openai))\n\n---\n\n## Additional Keys & Behavior to Know\n\nBeyond arrows, best practices from APG include:\n\n- **Home** key moves focus to the first tab. ([knowledge.evinced.com](https://knowledge.evinced.com/components/Tablist?utm_source=openai))  \n- **End** key moves focus to the last tab. ([knowledge.evinced.com](https://knowledge.evinced.com/components/Tablist?utm_source=openai))  \n- **Enter** or **Space** activates the focused tab if selection doesn\u2019t automatically follow focus. ([knowledge.evinced.com](https://knowledge.evinced.com/components/Tablist?utm_source=openai))  \n- Navigation should wrap around if the user presses arrow on the final or first tab (e.g. pressing Right on the last tab returns focus to the first). ([knowledge.evinced.com](https://knowledge.evinced.com/components/Tablist?utm_source=openai))  \n\n---\n\n## Why This Matters\n\nUsing the appropriate arrow keys for the orientation:\n\n- Aligns with what screen reader and assistive technology users expect. ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-orientation?utm_source=openai))  \n- Prevents confusion when Up/Down arrows are used improperly (e.g. hijacked for horizontal navigation), which can conflict with scrolling behaviors or other assistive tech conventions. ([w3.org](https://www.w3.org/TR/2018/WD-wai-aria-practices-1.2-20181218/?utm_source=openai))  \n- Supports consistency across components and devices, improving usability and predictability.  \n\n---\n\n## Summary\n\nIf you need a brief rule:\n\n- Horizontal tab layout \u2192 navigate with **Left / Right** arrows  \n- Vertical tab layout \u2192 navigate with **Up / Down** arrows  \n\nAlways declare `aria-orientation` so users (and assistive tools) know what orientation to expect. Use `Home`, `End`, `Enter` or `Space` as supplemental navigation keys.  \n\nIf you like, I can walk you through example screen reader output (NVDA, VoiceOver) for both horizontal and vertical tablists to help clarify how users perceive these behaviors."
    },
    {
        "role": "user",
        "content": "how%20should%20the%20items%20in%20a%20tablist%20be%20announced%20by%20a%20screen%20reader%3F"
    },
    {
        "role": "assistant",
        "content": "Here\u2019s what happens \u2014 and how it *should* happen \u2014 when a screen reader user navigates to an item in a well-implemented tablist. I draw from WAI-ARIA and typical screen reader behavior to show what needs to be in place and what the user should hear.\n\n---\n\n## Key Elements That Enable Correct Announcement\n\nFor each tab in a tablist, the following ARIA/HTML attributes (or equivalent semantic HTML) are essential:\n\n| Feature | Purpose |\n|---------|---------|\n| `role=\"tab\"` on the tab element | Tells assistive tech this is a tab, not a link, button or generic element. ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/tablist_role?utm_source=openai)) |\n| `role=\"tablist\"` on the container | Supports grouping, orientation context, and exposes the full set of tabs to the assistive tech. ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/tablist_role?utm_source=openai)) |\n| `aria-selected=\"true\"` / `\"false\"` on each tab | Indicates which tab is currently selected (active) versus inactive. ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/tablist_role?utm_source=openai)) |\n| `aria-controls` on the tab linking to its `tabpanel` | Associates each tab with the content that shows up when it\u2019s selected. ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/tab_role?utm_source=openai)) |\n| `aria-orientation` when vertical | Helps screen readers know which arrow keys are relevant. Horizontal is default. ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/tablist_role?utm_source=openai)) |\n| `tabindex` management | Only the active or focused tab should be in the tab order (`tabindex=\"0\"`), others ordinarily `tabindex=\"-1\"`. ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/tab_role?utm_source=openai)) |\n\n---\n\n## What Users Hear\n\nWhen focus lands on a properly coded tab, screen readers usually announce *several pieces of information*. While exact phrasing can vary by screen reader (VoiceOver, NVDA, JAWS, TalkBack, etc.), the announcements generally include:\n\n1. **Tab name / label**  \n   The visible label of the tab (or whatever `aria-label`/`aria-labelledby` provides).  \n   Example: \u201cSettings\u201d or \u201cProfile\u201d. ([accessuse.eu](https://accessuse.eu/en/tabbed-interfaces.html?utm_source=openai))\n\n2. **Role**  \n   \u201ctab\u201d is announced so the user knows this is a tab control.  \n   Example: \u201cSettings, tab\u201d. ([tink.uk](https://tink.uk/using-tabbed-interfaces-with-a-screen-reader/?utm_source=openai))\n\n3. **State \u2014 selected or not**  \n   If it's the active tab, the screen reader says \u201cselected\u201d (or \u201cactive\u201d), otherwise it may say \u201cnot selected\u201d or omit the state if it\u2019s clear.  \n   Example: \u201cProfile, tab, selected\u201d or \u201cSettings, tab, 2 of 4\u201d (if not active). ([accessuse.eu](https://accessuse.eu/en/tabbed-interfaces.html?utm_source=openai))\n\n4. **Position within the set**  \n   Users are told which tab this is in relation to the total (e.g. \u201cTab 2 of 5\u201d). This helps them understand the scope of choices. ([accessuse.eu](https://accessuse.eu/en/tabbed-interfaces.html?utm_source=openai))\n\n5. **Orientation or expanded/collapsed**  \n   Usually not needed if orientation is default, but \u201cvertical tab list\u201d or \u201chorizontal tab list\u201d is relevant when it\u2019s vertical or when aria-orientation is explicitly set. In certain implementations, \u201cexpanded\u201d might be read (if using aria-expanded improperly, though \u201cselected\u201d is the right state in a tab context). ([stackoverflow.com](https://stackoverflow.com/questions/34594159/a-tablist-tab-accessibility-is-it-normal-for-the-screen-readers-to-see-square-b?utm_source=openai))\n\n6. **If control is activated (activated vs focused)**  \n   If focus and selection are separate (manual activation), users need to know if it\u2019s just focused (hovering over) or actually selected (content shown). This is conveyed via `aria-selected`, and screen readers announce \u201cselected\u201d after activation or after `Enter`/`Space` depending on behavior. ([developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/tab_role?utm_source=openai))\n\n---\n\n## Example of a Typical Announcement\n\nHere\u2019s what a user might hear for the second tab out of four, which is currently selected:\n\n> \u201cProfile, tab, 2 of 4, selected.\u201d\n\nIf it\u2019s not selected:\n\n> \u201cAccount, tab, 3 of 4.\u201d\n\nIf the orientation is vertical and explicitly labelled:\n\n> \u201cSettings, tab, 1 of 3 in vertical tab list.\u201d\n\n---\n\n## Common Variations & Caveats\n\n- **Not all screen readers include every detail.** Some read less context (\u201c1 of 3\u201d) or drop \u201cselected\u201d unless it changes. Implementation of roles/states can affect this. ([stackoverflow.com](https://stackoverflow.com/questions/34594159/a-tablist-tab-accessibility-is-it-normal-for-the-screen-readers-to-see-square-b?utm_source=openai))  \n- **Manual vs. automatic activation model:**\n  If tabs activate on focus, moving focus may change selection, and users will hear \u201cselected\u201d immediately. If activation is manual (via Enter/Space), focus might move without activation, so \u201cselected\u201d comes only after activation. The distinction should be clear via documentation or hints. ([accessuse.eu](https://accessuse.eu/en/tabbed-interfaces.html?utm_source=openai))  \n- **Screen reader settings and versions:** Different combinations (browser + screen reader + platform) can produce slightly different wording, or omit certain state announcements. But if ARIA roles & attributes are properly set, at least the name-role-state pattern is reliably present. ([stackoverflow.com](https://stackoverflow.com/questions/34594159/a-tablist-tab-accessibility-is-it-normal-for-the-screen-readers-to-see-square-b?utm_source=openai))  \n\n---\n\nIf you want, I can also compare actual announcements from NVDA, VoiceOver, and TalkBack for the same tab interface \u2013 that way you can hear how much varies in practice."
    },
    {
        "role": "user",
        "content": "if%20a%20screen%20reader%20user%20cannot%20navigate%20the%20items%20in%20a%20tablist%20with%20their%20arrow%20keys%2C%20what%20wcag%20success%20criteria%20does%20this%20not%20meet%3F"
    },
    {
        "role": "assistant",
        "content": "If a screen reader user *cannot* navigate between items in a tablist using the arrow keys (assuming the tablist is implemented with ARIA roles or custom widget behavior), that indicates failure of one or more WCAG success criteria in the **Operable** principle. Below are the most relevant criteria:\n\n---\n\n## Key WCAG Criteria Violated\n\n| WCAG Success Criterion | Level | Description | How lack of arrow-key navigation violates it |\n|---|---|---|---|\n| **2.1.1 Keyboard** | Level A | *All functionality of the content is operable through a keyboard interface without requiring specific timings for individual keystrokes.* ([wcag.dock.codes](https://wcag.dock.codes/documentation/wcag211/?utm_source=openai)) | If arrow keys are expected to move between tabs but don\u2019t, keyboard-only users can\u2019t access or activate all tab items. Thus the component isn't fully operable via keyboard. |\n| **2.1.2 No Keyboard Trap** | Level A | *If keyboard focus can be moved to a component using a keyboard interface, then focus can be moved away from that component using only a keyboard interface.* ([thewcag.com](https://www.thewcag.com/principles/operable?utm_source=openai)) | If arrow keys are the only way to move focus within the tablist but the user cannot exit the list using keyboard (because arrow keys aren\u2019t supported or binding is missing), they may be trapped within or unable to navigate the component properly. |\n| **2.4.3 Focus Order** | Level A | *Focusable components receive focus in an order that preserves meaning and operability.* ([thewcag.com](https://www.thewcag.com/principles/operable?utm_source=openai)) | Users expect a predictable, logical focus sequence: if arrow keys are standard for tab navigation, this should be supported. If focus order or navigation behavior is inconsistent with common keyboard interactions (tabs and arrows), then meaning and operability may be compromised. |\n\n---\n\n## Why Arrow-Key Navigation Matters\n\n- For custom controls with `role=\"tab\"`, ARIA recommended patterns define arrow key behavior (Left/Right for horizontal tablists, Up/Down for vertical) for navigation between tabs. If these are missing, users lose ability to move between tabs in an expected manner.  \n- Without arrow-key navigation, keyboard-only users often cannot interact fully, or must use awkward or non-standard methods, reducing usability and sometimes even blocking access completely.  \n\n---\n\nIf you like, I can also walk you through specific ARIA Authoring Practices documentation that outlines how arrow-key behavior *must* work for tablists \u2014 and how screen readers expect it."
    }
]