← Blog
26 Nov 2026tabs ui designtab component accessibilityARIA tabsresponsive tabsVue tabs

Tabs UI Design: Accessible Patterns That Actually Work

Learn Tabs UI Design: when to use tabs, keyboard and ARIA patterns, responsive layouts and a Vue implementation you can test before release.

Tabs UI Design: Accessible Patterns That Actually Work

You ship the tabbed account page on a Thursday. The underline slides between Overview, Activity and Settings, the panels change with a fade, and the automated accessibility report comes back clean. On Monday a support ticket lands: a keyboard user cannot get past the tab strip. Another comes from a screen-reader user who says the selected tab never reads as selected. A third comes from someone who deleted a tab and found their focus gone entirely.

None of these are exotic bugs. They are the predictable result of treating a tab component as a visual layout instead of what it is: a small state machine. Every tab has a focus state, a selection state, a loading state, a failure state and an appearance state. Each one needs an attribute that expresses it to a computer, and a test that proves it still works.

The stakes reach beyond one dashboard. Many disabled users depend on keyboard access, and a tab strip that swallows focus blocks the route through the product. The spacing, indicator and panel transition can all be correct while the component still fails at the state level.

If you’re picking up tabs UI design from scratch, treat the state machine first and the styling second. The expensive bugs usually live in the states, not the pixels.

Table of Contents

Anatomy of a Tab Component and Its Parts

A tab component is a set of mutually exclusive views that share one content region. Think of a filing cabinet with labelled dividers where only one drawer is open at a time. The drawer doesn’t move the cabinet, and that’s the whole architectural advantage: switching content without shifting the rest of the page.

That structure breaks into five parts you need to name before you design anything. Miss one and the component fails in a way that looks like a styling problem.

  • The tab list groups the controls and owns the semantics for the whole strip.
  • The tab buttons are the individual controls, one per view.
  • The visible panel shows the content for the selected tab.
  • The inactive panels sit hidden but stay associated with their tabs.
  • The selected indicator is the visual cue for which view is active.

The early Disability Rights Commission web investigation recorded 16 navigation problems described as confusing or disorienting mechanisms, and its task testing found blind participants completed 53 per cent of assigned tasks successfully, against an average of 82 per cent for participants with other impairment groups. The report predates modern ARIA, but the lesson holds: when the interface changes dynamically, users depend on structure they can perceive, not decoration they have to infer.

Part ARIA role Required attributes Purpose
Tab list tablist aria-label or aria-labelledby; aria-orientation when the strip is vertical Groups the tabs and holds the single keyboard stop
Selected tab button tab id, aria-selected="true", aria-controls, tabindex="0" The control the user activates to show its view
Inactive tab button tab id, aria-selected="false", aria-controls, tabindex="-1" Reachable with arrow keys, skipped by the Tab key
Visible tab panel tabpanel id, aria-labelledby pointing at its tab The content region shown for the selected tab
Inactive tab panel tabpanel id, aria-labelledby, hidden Out of view and out of the accessibility tree
Selected indicator None, visual only Contrast of at least 3:1 plus an underline or fill Shows selection beyond colour alone

The visual underline or fill is decoration. aria-selected is the fact assistive technology reads, and it must be set correctly even on a tab that looks perfect.

The four visual states to specify with the ARIA ones

Designers need to hand over more than a default look. Pair each visual state with the attribute that carries it.

  • Default and hover on inactive tabs. A hover treatment that doesn’t imply selection.
  • focus-visible ring. At least 3:1 contrast against its background, tested on the selected tab as well as the others. Losing the ring on the active tab is the most common visual regression in shipped components, because teams assume the underline is enough.
  • Selected. Colour plus a second cue: an underline, a weight change or a filled background. Colour alone fails anyone with low colour vision.
  • Disabled. Reduced contrast, no pointer affordance, and skipped by the arrow keys rather than focusable but dead.

The selected tab is the one users lose track of, not the unselected ones. If the focus ring only appears on tabs that aren’t current, keyboard users get no confirmation of where they are.

Before writing code, sketch the component on paper and answer five questions. Is there one list? Is there one button per view? Is exactly one panel visible? Does every tab’s id match exactly one panel’s aria-labelledby? Does the selected tab keep its focus ring? That’s the whole anatomy review, and it catches most structural mistakes ten minutes before they become a merge request.

Choosing the Right Pattern

A record page with Overview, Activity and Settings has a different job from a help article people read top to bottom. Choose the pattern before styling, because the choice decides whether the content region stays put or moves. GOV.UK’s accordion guidance draws that line cleanly: tabs keep the content region in place, while accordions expand and push later content down. Users either keep their position on the page or lose it.

Treat the tab component as a state machine, not a strip of labels. The selected tab defines which panel is current, the focused tab defines where keyboard interaction sits, and loading or failure states decide what the panel communicates. Each state needs an attribute or visible cue that expresses it, plus a test that proves it. A selected tab must agree with its panel, a focused tab must stay visible, and inactive panels must stay out of keyboard navigation while remaining associated with their controlling tab.

Tabs work best for related views people revisit, such as Overview, Activity and Settings on one record. They also fit rapid switching where the surrounding page must stay visible and stable. The third good case is short parallel content of similar size, where each view is scanned rather than read. Used that way, tabs reduce the distance between contexts without resetting the page. The pattern earns its place when the return trip is one arrow key and the panel stays in the same region.

They fail in three common cases. Long guidance split across tabs forces sequential reading through a control built for random access. Content users compare side by side fights the one-visible-panel rule. A sidebar of seven tabs on a phone wraps badly, pushes labels into two cramped lines and buries the panel below the fold. That last failure is easy to miss in a desktop mockup, where labels look settled and the panel sits close to the strip.

Criterion Tabs Accordion Stacked sections
Content region Stays in place Expands and pushes later content down Page grows vertically
Best for Related views users revisit Several sections inspected together Long or sequential reading
Compare sections at once No, one visible at a time Yes, several can be open Yes, all are visible
Keyboard cost One tab stop, then arrow keys One button per section Scroll only
Weak case Long guidance or sequential tasks Quick switching between views Scanning many sections on a phone

For implementation, keep labels short and semantically distinct. Hold the selected-state indicator beyond colour, because colour alone leaves low-colour-vision users guessing. Pull inactive panels out of keyboard navigation while keeping the relationship between each tab and its panel clear. Short labels reduce wrapping at narrow widths, while distinct labels stop people choosing between “Information”, “Details” and “More” as if they were different questions.

The three-question test

Apply this to any content block before you reach for tabs.

  1. Do users compare this with other blocks? If yes, stacked sections or a wider layout beat a tab strip, because comparison needs simultaneity.
  2. Do they read it in order? If yes, stop. Tabs let people enter anywhere, which is wrong for a sequence.
  3. Do they return to it? If yes, tabs earn their place, because the content region never moves and the return trip costs one arrow key.

Two yes answers out of three is your signal. One yes and two noes usually means the content wants to be a page, not a panel.

Test the decision with disabled users and people with low digital skills, including assistive-technology users. Turn the layout argument into acceptance criteria: keyboard-only completion, screen-reader verification, focus restoration after switching, and workable behaviour at narrow widths.

For a wider library around these primitives, use Steeve Elgui’s UX UI portfolio as a visual reference when comparing component and layout decisions.

Keyboard and Focus Behaviour Users Expect

The keyboard model is fixed and it shapes everything else: the tab list is a single stop in the tab sequence, and Left and Right Arrow move between the tabs inside it. The UK Intelligence Community Design System documents exactly this model and reports testing against WCAG 2.2 Level AA with NVDA and VoiceOver, plus users with different interaction methods. Asking someone to press Tab seven times to reach the seventh view is the wrong contract, and it’s the one most improvised components ship with.

Key Action Focus lands on
Tab Leaves the tab list for the active panel The first focusable element in the panel, or the panel itself
Shift + Tab Returns from the panel to the tab list The selected tab
Left Arrow or Right Arrow Moves to the previous or next tab, wrapping at the ends The adjacent tab
Home Moves to the first tab The first tab
End Moves to the last tab The last tab
Enter or Space Activates the focused tab in manual mode The panel the tab controls
Delete Removes a deletable tab, if the pattern supports it The neighbouring tab

The mechanism behind that single stop is roving tabindex. The selected tab carries tabindex="0"; every other tab carries tabindex="-1". The component moves that value as focus moves, so the strip is always one Tab press away and always one arrow press between views. Get this wrong and the fix is usually worse than the bug: teams add tabindex="0" to every tab, keyboard users drown in tab stops, and the strip stops behaving like a group.

Each tab also needs a stable link to its panel through aria-controls, with aria-selected="true" on the active tab and "false" on the rest. Panels update visibility without leaving several hidden panels discoverable in the accessibility tree. In a Vue or web-component implementation, keep the active index and the roving tabindex as component state, then restore focus to the newly selected tab after arrow navigation. That combination prevents the failure mode where hidden content stays reachable and screen-reader users hear panels they can’t see.

Automatic or manual activation

Both modes exist, and the choice follows what happens when you switch.

Automatic activation moves focus and selects the panel in one key press. It’s right for panels that appear instantly, because asking for a second keystroke after a fast switch adds friction for no benefit.

Manual activation moves focus between tabs but waits for Enter or Space to change the panel. Reach for it when switching triggers a slow request, so someone holding the Right Arrow doesn’t fire five network calls on the way to the tab they want.

Rule of thumb: if a panel takes longer to appear than a key repeat, make activation manual. If it’s instant, automatic.

Focus restoration has one testable rule. After a key press moves focus, the newly focused tab must be visible in the strip, and the panel that appears must be the one that tab controls. On a scrollable strip that means calling scrollIntoView on the focused tab, otherwise the selection moves while the visible portion of the strip doesn’t.

The focus ring itself deserves its own pass, because focus-visible behaves differently from :focus and most regressions live there. The guide to handling focus-visible in CSS covers the cases where the ring must stay on the selected tab rather than blinking away after a mouse click.

Screen Reader and Voice Control Support for Tabs

Navigation is where accessibility fails most often, and tabs are navigation in miniature. In the 2019 Click-Away Pound survey, 59 per cent identified poor link information and navigation as an issue, down only two points from 61 per cent in 2016, and screen-reader access affected 35 per cent of respondents. A tab strip either resolves that or adds to it.

Start with what a screen reader says when focus lands on a tab. It announces the accessible name, the role, the position and the selected state, in that order of importance. So a focused tab should produce something like “Activity, tab, 2 of 3, selected”, where the position comes from the set size and the selected state comes from role="tab" combined with aria-selected. Remove either half and the user hears a button with no place in a sequence.

A blind person wearing headphones using a computer with an accessibility dashboard and inclusive design books.

The name must match the word on screen

Voice control users speak the label they can see. If the visible text says Activity but the accessible name is “activity-tab” or the button carries only an icon, the command has nothing to match. A tab labelled More is vague to everyone and unaddressable to voice control, which needs the visible words to be the accessible name.

Panels have the same obligation in reverse. Each panel’s aria-labelledby points back at its controlling tab, so a screen reader announces the region with its name rather than as an unnamed container. Inactive panels use the hidden attribute, which pulls them out of the accessibility tree rather than leaving their text to be read as if it were on screen.

A tab and its panel are one object with two faces. If the panel has no name, the user has arrived somewhere unlabelled and doesn’t know which tab put them there.

Status changes need a different channel. When a panel loads results or finishes a background action, write to a polite live region, not to the focused element. Stealing focus to announce “12 results loaded” moves the user away from the work they were doing. A small status line with role="status" announces without interruption.

The five-minute screen-reader pass

Run this on a single screen with a real screen reader, NVDA on Windows or VoiceOver on macOS. It catches the majority of tab defects.

  • Labels match visible text. Read each tab aloud as it appears on screen, word for word.
  • Exactly one tab is selected. Arrow through every tab twice and confirm the announcement never shows two selected states or none.
  • Every panel has a name. Land in each panel and confirm the region is announced with its tab’s label.
  • No inactive content is read out. Browse through the page linearly and check hidden panels stay silent.
  • The position is right. Confirm “2 of 3” updates when a tab is added or removed.

If you want a repeatable script rather than a one-off check, this walkthrough of screen reader testing for component libraries sets out the order of checks and what counts as a pass. For teams also working against US compliance expectations, this ADA compliant website design roadmap maps the testing obligations onto the same component contracts.

Responsive Tabs From Phone to Wide Screen

A tab component is a state machine wearing different clothes at different widths. Selection state, focus position and orientation are states with attributes, and none of them change when the viewport does. Only the layout changes. That is the constraint that keeps a responsive tab strip honest: the visual adaptation must never break the focus model underneath. Four layouts cover most products.

  • Below 480 px. A horizontal scroll strip, with the next tab partly visible so people can see more exist. The focused tab must scroll into view when arrow keys move the selection. Test this by holding Right Arrow past the visible edge: the strip should track focus, not leave it off screen.
  • 480 to 767 px. Equal-width tabs, or a wrapped two-row layout when labels are short enough to fit without clipping. Wrapping changes the visual row count but not the arrow-key order, which still follows the DOM sequence.
  • 768 to 1023 px. The full horizontal list, optionally with icons beside labels.
  • 1024 px and wider, or in a sidebar. A vertical tab list with aria-orientation="vertical", which swaps Left and Right Arrow for Up and Down Arrow. Flip the orientation attribute with the layout, not just the CSS. A sidebar tablist that announces horizontal while looking vertical is the classic responsive defect, and a screen reader pass through the sidebar is the test that catches it.

A diagram illustrating four responsive tab layout variations for different screen sizes from mobile to desktop.

The overflow menu trap

When the count grows past what a phone can show, one pattern holds up: keep the first three or four tabs visible, and put the rest behind a More button that opens a menu with the same roving keyboard behaviour. The state machine gains a “hidden in overflow” position for some tabs, and that position is the trap. Tabs hidden in an overflow menu are easy to miss, and a view nobody notices is a view that doesn’t exist. Keep the most used views visible and move the rarely opened ones inside.

Touch targets need room. Aim for 44 by 44 px on touch devices with spacing between tabs. Accessibility standards set a smaller floor than that for pointer targets, and I treat the floor as a bare minimum rather than a goal: cramped targets produce mis-taps, and a mis-tap on a tab strip swaps content, which is more disorienting than a missed button press. Padding around each tab also gives the selected state’s visual indicator room to breathe, since an underline pressed against its neighbour reads as noise rather than selection.

Before release, test each layout at 320 px, 768 px and 1280 px. These are the widths where the layout states change hands, so they are the widths where attribute drift shows up. Then change orientation mid-session, rotating a tablet or resizing a desktop window across a breakpoint, and confirm three things: the arrow keys follow the new layout, the orientation attribute flips with it, and the selected tab stays selected. Selection is a state, not a style, and a breakpoint crossing should never reset it to the first tab.

How to Build a Vue Tab Wrapper with v-model and Focus Control

Keep the wrapper thin. The job of a Vue tab wrapper is to bind state and render slots; the job of the primitive underneath is to own focus, selection and announcement. Mixing the two is how teams end up with focus logic duplicated in three components and fixed in none.

  1. Define tabs as data. An array of objects with id, label and an optional disabled flag. The disabled flag matters early, because skipping it later means rewriting the key handler.
  2. Bind a v-model value holding the active id, so the parent owns selection and can read it without reaching into the child. Two-way binding here is the difference between a component and a black box, and the mechanics of v-model in Vue are worth getting right once rather than per component.
  3. Render the tablist with one button per tab, each carrying its id, aria-controls and aria-selected derived from the model, plus tabindex="0" only on the selected tab and -1 on the rest. Derive, never hardcode; a hardcoded selected state drifts the first time someone adds a tab.
  4. Render the panels with role="tabpanel", aria-labelledby pointing at their tab, hidden on the inactive ones, and named slots so each panel keeps its own content and state. Slots preserve component state across switches, which is why hiding beats removing for form panels.
  5. Handle Left, Right, Home and End inside the wrapper. Compute the next index, skipping disabled tabs and wrapping at both ends, emit the new value, then move focus after the DOM updates with nextTick.

A five-step instructional diagram illustrating how to build a Vue tab wrapper with keyboard focus control.

The timing slip in step five is worth naming because it fails without warning. Setting focus before the panel becomes visible drops the keyboard user back on the old tab, with no error in the console and no visual clue in the browser. The fix is the nextTick call, and the reason is simple: a panel that is still hidden cannot take focus, so the browser hands focus to whatever could.

What a bug here looks like: the panel swaps on screen but the next arrow press moves from the wrong starting point, because the component’s idea of the focused tab and the browser’s have quietly diverged.

A primitive-level component earns its place precisely here. Tabs ship across Vue 3, Web Components and Tailwind CSS in our library, and the wrappers bind the selected value and slots while the primitive owns focus, disabled-tab skipping and Home and End. Your component then needs props, slots and events, and nothing else.

The acceptance test is visual and behavioural at once. The selected panel swaps, arrow keys keep focus inside the strip, and no key press lands focus outside it. If a key press escapes the strip, the wrapper is doing half the job.

Async Content, Deleted Tabs and Deep Links

A tab strip with good labels can still fail the moment content loads, validation runs or the URL changes. That is why a tab component should be treated as a state machine, not a visual layout. Each state needs an attribute that expresses it and a test that proves it. Focus, selection, loading, failure and visibility all have to agree, or keyboard, touch, screen reader and voice control users get different interfaces from the same markup.

I would judge a tab component by those states before judging its animation. A smooth transition means little if a failed panel stays silent, a deleted tab drops focus to the page body, or a deep link opens an empty view. The component should keep selection and focus aligned as data arrives, errors surface and the tab list changes.

Six states nobody specifies

  • A slow panel. Set aria-busy="true" on the panel while data loads, then write the result to a polite live region when it is ready. The attribute expresses loading, and a quick load test proves the panel is announced only after content exists. Silence during a load is indistinguishable from a broken tab.
  • A form with errors. If validation fails on a tab that is not open, switch to that tab and move focus to an error summary at the top of its panel. Selection, focus and the error state then point to the same place. Leaving the error on a hidden tab means the user submits, sees nothing change, and submits again.
  • A deleted tab. Move focus to the neighbouring tab and announce the new selection. The test is simple: delete the active tab, then press Tab once. Focus falling to the body is the worst outcome, because the next Tab press restarts from the top of the page.
  • A newly added tab. Insert it in reading order and set aria-setsize and aria-posinset where the count matters, so the announced position stays truthful. Check the announcement after insertion, not only in the rendered strip.
  • A deep link. A URL naming a tab should select it on load, and an unknown id should fall back to the first tab rather than an empty panel. Reloading the URL proves whether the selected state is real or only a click effect.
  • A hidden versus removed panel. Hiding keeps state, scroll position and typed input; removing frees memory and loses all three. Default to hiding for anything interactive, and use removal only where stale state would be more costly than re-entry.

Three tests cover this ground in under ten minutes. Delete the active tab. Reload on a deep link. Submit an invalid form from the second tab. Each one checks a state pair: focus after deletion, selection after routing, and error recovery after validation.

Each one fails loudly in a live browser and goes unnoticed in a component library. A demo with static panels can look finished while these paths are still undefined. Run them before the component reaches a shared branch, not after it reaches a production screen.

Confirm Your Tab Component Before You Ship It

Turn the guide into a gate the team repeats on every tab component. Run each row of the log on one real screen, record the outcome, and name the rule a failure breaks. Naming the rule keeps fixes targeted instead of cosmetic.

Triage by severity. Lost focus after deleting a tab, a missing aria-selected, and an inactive panel still exposed to the screen reader block release. A wrapped label at 320 px or a target under 44 by 44 px gets fixed before the next release. A missing hover state is polish.

A checklist table titled Confirm Your Tab Component Before You Ship It for web accessibility testing.

Test How to run it Rule a failure breaks Fix
Keyboard sweep Tab into the strip, then Left, Right, Home and End across every tab One stop in the tab sequence with roving tabindex Focus stays visible on the selected tab and wraps at both ends
Screen reader pass NVDA and VoiceOver on each tab and panel role, aria-selected or panel naming Name, role, tab 2 of 3 and selected state are announced
Voice control Say each visible label to open its panel Accessible name differs from the visible text Label each tab with the words on screen
Narrow width Set the viewport to 320 px and open each tab Layout overflow or targets under 44 by 44 px Scroll or wrap the strip, keep 24 by 24 px minimum targets
Deep link reload Open a known tab id, then an unknown id Unknown id shows an empty panel Fall back to the first tab
Async panel Load a slow panel and wait for the result aria-busy missing, status never announced aria-busy true while loading, polite live region on completion
Validation error Submit an invalid form from the second tab Error stays on a hidden tab Switch to that tab and focus the error summary
Delete the active tab Remove the selected tab with Delete Focus falls to the body Focus moves to the neighbouring tab and the new selection is announced

The pass bar is specific. Keyboard-only completion of every tab including Home, End and wrapping at both ends. An NVDA and VoiceOver pass that names each tab with its position and selected state. Voice activation by the visible label. A 320 px width check. A deep-link reload against a known and an unknown id. A run through loading, validation-error and deletion. The reference points used here, the UK government design system among them, are tested against WCAG 2.2 AA, which is the standard this gate measures against.

Accessibility isn’t a feature you add after the styling is agreed. It’s the component. The visual states sit on top of a contract that already works.

We ship tabs among the Vue 3, Web Components and Tailwind CSS primitives in DOM Studio, so a team can start from a component that already meets this contract and run the same log against it rather than writing focus management from scratch.

Run the log on one real screen this week and file every failure. A tab component that loses focus is a tab component that loses users, and the fix costs less now than it does after the audit.


When you’d rather start from a component that already carries the focus model, the roving tabindex, and the panel naming, our tabs at DOM Studio are built to pass this gate rather than need it retrofitted. Take the primitive, wire it to your v-model, and spend the saved week on the states that need your judgement, like async panels and deep links. Run your own defect log against a real screen and see what still needs fixing before release.