← Blog
27 Nov 2026tabs in websitewebsite tabsaccessible tabsARIA tabs patterntab interface design

Tabs in Website Design: How They Work and When to Use Them

Learn how tabs in website interfaces work, when to use them, and how to build accessible tab sets with keyboard support, ARIA roles and UK testing.

Tabs in Website Design: How They Work and When to Use Them

You’re looking at a product page or an account screen that has grown too tall. Half the details sit below the fold, stakeholders want the layout to feel cleaner, and the quickest fix seems obvious: drop a neat row of tabs across the top and tuck the extra content out of sight.

Most tutorials treat tabs in website interfaces as a quick CSS job. Style three buttons, toggle a class with JavaScript, and ship it. That visual shortcut skips the harder questions: whether your content belongs in tabs at all, what happens when someone can’t use a mouse, and how a screen reader announces a panel that swaps beneath a button.

Building reliable tabs starts with understanding the interaction pattern itself, deciding when another layout serves readers better, and wiring up the keyboard and ARIA behaviour that turns a styled row of boxes into a dependable control.

Table of Contents

What Website Tabs Are and How They Work

Consider a shopper browsing a product page for a pair of hiking boots. Below the price and add-to-basket button sits a horizontal strip with three labels: Specifications, Reviews, and Delivery. The shopper clicks Specifications and reads the weight and sole material right there in the content box. Next, they click Reviews, and customer ratings replace the specifications without the browser reloading the page. Clicking Delivery swaps the box again to show dispatch times and return costs.

That single interaction defines the website tab pattern. You have a row of labelled buttons, one content panel paired with each button, and exactly one tab active at a time. Think of a physical ring binder with coloured card dividers: it’s still one document, only one section lies open in front of you, and the highlighted divider tells you which section you’re reading.

Here is how those clicks map to the underlying pattern without triggering a page reload.

An infographic illustrating how website tabs work for user navigation without requiring a page reload.

The Anatomy of a Tab Set

When you build tabs in website layouts, you aren’t building one element. You’re coordinating three connected parts and a shared visual state:

  • Tab list: The wrapper container that groups the tab buttons together and signals to assistive technology that those buttons form a single set of choices.
  • Tab: Each clickable, keyboard-focusable label inside the tab list that controls a specific view.
  • Panel: The content region paired with a tab, which becomes visible when its tab is selected and stays hidden when another tab takes over.
  • Active state: The combined visual and programmatic indicator showing which tab is currently selected and ensuring only its matching panel appears on screen.

A quick way to tell tabs apart from standard site navigation is to watch the browser’s address bar and the label strip. If the labels stay fixed in place and only the panel below them swaps content, you’re looking at a tab set. If clicking a label changes the route and loads a fresh page, that’s standard link navigation dressed up to look like tabs, and it should stay coded with <a> elements rather than tab roles.

Mental model: Tabs switch between views inside a single page. Links take a visitor to a different page. Mixing the two breaks browser history, keyboard expectations, and screen reader announcements all at once.

Keeping those four terms straight (tab list, tab, panel, and active state) makes every design, accessibility, and code decision much easier to communicate across a team.

When Tabs Fit and When to Choose Something Else

Tabs work best when a reader needs to inspect several equivalent views of one item, one view at a time. Product specifications, customer reviews, and delivery policies on a single item page fit that rule neatly because shoppers rarely read all three from top to bottom in sequence.

Before defaulting to tabs, weigh them against the three patterns that solve similar layout problems without hiding content behind a click.

Pattern Best for Main weakness Accessibility note
Tabs Several equivalent views of one item, shown one at a time Hidden content is hard to find and print; cramped on small screens Needs the full ARIA tab pattern and managed focus
Accordion Long stacked sections a reader opens selectively Users open many panels and lose their place Simple disclosure buttons with aria-expanded
Headings with anchor links Long content read top to bottom or searched Longer page with less visual separation Headings give screen reader users navigation landmarks
Separate pages Views with their own address, or tasks in a fixed order More clicks and lost context between pages Each page works as a standard page with its own title

Tabs save vertical space, but that tidiness comes at a real cost. Any text sitting inside an inactive panel is invisible to a quick visual scan, ignored by browser print previews unless styled specifically for print, and missed by Ctrl+F page search in many browsers. If a visitor needs to compare two views side by side or read every detail in order, hiding sections behind tabs creates friction rather than clarity.

Even well-researched design systems treat tabs with caution. The GOV.UK Design System tabs guidance explicitly notes that more research is still needed to determine whether tabs are the best option for screen-reader users and sighted keyboard users, and how they should behave on small screens. The same guidance points out that clear headings improve navigation for screen-reader users and on narrower viewports. Treat tabs as an option you test against real tasks, not a safe default for shrinking a long page.

A Three-Question Test Before You Commit

When you’re deciding whether a block of content belongs in a tab set, run it through three quick checks:

  1. Are the views parallel and independent? If users must finish step one before moving to step two, use separate pages or a stepper instead of tabs.
  2. Is each view concise enough to scan quickly? Long, multi-heading articles inside panels feel claustrophobic and make scrolling awkward.
  3. Can the reader finish their task looking at one view at a time? If they have to flip back and forth between two panels to compare numbers or instructions, put the content under headings or inside an accordion component so multiple sections can stay open together.

If you answer “no” to two of those three questions, walk away from tabs. Plain headings with a short jump-link list, or a stacked accordion, will be simpler to build, easier to scan on a phone, and more forgiving for keyboard and screen reader users.

Where Website Tabs Appear and What They Achieve

Once a piece of content passes that test, tabs earn their keep across four familiar web contexts. Each one solves a specific layout problem without forcing a full page reload.

Retail product pages are the classic example. A shop keeps the product photos, price, size selector, and primary buy button above the fold, then groups Description, Specifications, Reviews, and Delivery in a tab set beneath. That keeps purchase actions immediately reachable while letting detail-minded shoppers check dimensions or shipping fees without scrolling past forty reviews first.

A hand pointing at the specifications tab of a watercolor paint set on an online shopping website.

Account and settings screens use tabs to divide unrelated forms that a user visits weeks apart. Splitting Profile, Billing, Notifications, and Security into panels prevents a single massive form where an accidental edit in one area gets tangled with another. When teams overhaul cluttered service or customer portals, organising related views cleanly often pairs well with broader redesign steps that boost local leads by cutting visual noise around the main call to action.

Analytics dashboards rely on tabs to pivot a single chart or table across time ranges such as Day, Week, Month, and Year. The surrounding filters, metrics, and page chrome stay anchored, so the reader notices how the curve changes without losing spatial context.

Developer documentation sites put tabs to work on package-manager and language snippets. Switching a single code block between npm, yarn, and pnpm lets a developer copy the exact install command they use while keeping the surrounding setup guide compact and readable.

Every successful tab set shares one condition: the visitor is hunting for one relevant view, not reading every panel from start to finish.

Patterns That Look Like Tabs but Are Not

Developers often confuse visually similar controls with website tabs, which leads to the wrong HTML and broken keyboard behaviour.

  • Browser split features: Tools built into the browser itself, such as Firefox Split View placing two web pages side by side in one window, are browser chrome rather than website tabs. They don’t belong in your page markup and require no ARIA roles from you.
  • Pricing billing toggles: A monthly versus annual switch on a SaaS pricing table often gets styled like a two-tab pill, yet it changes prices across the whole page rather than swapping a single content panel. Code that control as a toggle switch (role="switch" or a checkbox) or a radio group instead.
  • Primary site navigation: A horizontal bar across the header that routes users to /features, /pricing, and /contact is a <nav> landmark containing <a> links, even if the active item wears a bottom border that looks like a tab.

Sharing Links to a Specific Tab

One frustration with client-side panels is sending a colleague a link to the Delivery tab and having them land on Description instead. If users might bookmark or share a specific view, store the active tab’s identifier in the URL fragment (such as #delivery) when a tab is activated, and read that hash on page load to open the matching panel. Updating the hash cleanly also helps the browser Back button behave predictably when someone jumps from an external link straight into a secondary panel.

Choosing Activation Mode and Small-Screen Layout

Styling tabs is straightforward; deciding how they react to keyboard focus and narrow screens is where real usability breaks down. Two interaction choices shape the experience more than colours or borders ever will: activation mode and small-screen behaviour.

In automatic activation, moving keyboard focus to a tab with the arrow keys immediately displays its panel. That feels crisp and responsive when every panel’s content is already in the DOM, such as static specifications, short text summaries, or preloaded images.

In manual activation, arrow keys move focus along the tab list without changing the visible panel until the user presses Enter or Space. Choose manual activation whenever opening a panel fetches data from an API, renders a heavy canvas chart, or triggers a noticeable layout shift. If focus alone fires network requests as a keyboard user arrows from tab one to tab four, the page stutters and screen readers get flooded with unwanted updates.

Practical rule: Use automatic activation only when every panel renders instantaneously without network delay. If even one panel loads asynchronously or causes lag, switch the whole tab set to manual activation.

Handling Narrow Viewports and Overflow

A row of five labels that sits comfortably on a wide desktop monitor quickly runs out of room on a narrow phone screen. You have three realistic layout options, and each carries a trade-off:

  • Avoid wrapping onto two lines: Multi-row tab lists visually detach the active tab from the panel below it when the selected button sits on the upper row, confusing users about which label owns the visible content.
  • Use horizontal scrolling with an edge cue: Keeping tabs in a single scrollable strip works well for four to six concise labels, provided a subtle gradient fade or a partially visible label at the right edge signals that more tabs sit off screen.
  • Transform into an accordion on mobile: Below a chosen viewport width, swapping the tab layout into vertically stacked disclosure panels keeps long labels legible and stops cramped touch targets. Planning where that shift happens alongside your media query breakpoints prevents awkward in-between widths where labels clip awkwardly.

Teams redesigning mobile navigation for smaller business sites can also cross-check touch target spacing and viewport scaling against responsive design best practices for SMBs so tab strips don’t crowd out primary actions.

How many tabs can users juggle before overflow becomes a problem? In an 8 October 2025 YouGov survey of 5,382 adults in Great Britain, 28% of respondents typically kept 2 to 3 browser tabs open on a desktop or laptop, 26% kept 4 to 5, and 8% reported 16 or more when the 16 to 20 (3%), 21 to 30 (2%), and over 30 (3%) groups are combined. Keep the scope clear: that survey measures browser tabs across all open windows rather than tabs inside a website component, so it shouldn’t dictate an exact in-page limit. Still, it reflects a broader UK browsing habit worth respecting: many users work comfortably within small sets of tabs, while a clear minority deals with heavy overflow, which is why your interface must stay crisp with three or four labels and degrade gracefully if a product team adds more.

Pick your activation mode and small-screen layout as a single decision, then test both on an actual phone and with a physical keyboard before locking the CSS.

How to Build an Accessible Tab Set

Screen readers don’t guess that three styled <div> elements sitting above a box are tabs. A clickable <div> announces nothing about its role, ignores the keyboard unless you manually add focus and key handlers, and gives a blind user no clue that content changed elsewhere on the page.

This overview maps the ARIA structure and keyboard flow you need before writing a line of styling.

A six-step infographic illustrating the process of building an accessible website tab set using ARIA attributes.

Implementing the WAI-ARIA tabs pattern gives assistive technology explicit relationships between every button and its content. As UK Government developer accessibility guidance warns, incorrectly implemented ARIA can block disabled users from using a service altogether, and dynamic ARIA states must stay synchronised with your JavaScript behaviour at all times.

Build the structure first, then layer keyboard behaviour on top:

  1. Wrap the buttons in role="tablist". Give the wrapper a clear accessible name with aria-label="Product information" or aria-labelledby pointing to a visible heading. Screen readers use this to announce when a user enters the tab set and what the tabs belong to.
  2. Use native <button> elements with role="tab". Keep the buttons in the same logical order as their panels. Native buttons already handle click events and focus cleanly; adding role="tab" tells assistive technology how many tabs exist and which position the user is on (“Reviews, tab, 2 of 3”).
  3. Give every content container role="tabpanel" and a unique id. Without an id, you can’t programmatically bind the panel to its controlling button.
  4. Wire up two-way references. Put aria-controls="panel-reviews" on the tab button and aria-labelledby="tab-reviews" on the matching panel. That lets screen reader users hear which tab owns the region they just entered.
  5. Synchronise selection state and panel visibility. Set aria-selected="true" on the active tab and aria-selected="false" on every inactive tab. Apply the hidden attribute (or display: none) to inactive panels so hidden text is removed from the accessibility tree and can’t trap focus.
  6. Manage focus with roving tabindex. Put tabindex="0" on the active tab and tabindex="-1" on all inactive tabs. That way, pressing Tab lands on the active tab once, and pressing Tab again moves straight into the open panel instead of forcing keyboard users to step through every single tab button to escape the list.
  7. Bind arrow keys, Home, and End. Update tabindex, aria-selected, and panel visibility in lockstep whenever the active tab changes, and keep a clear visible focus ring on whichever tab holds focus.

If you’re also tightening headings, contrast, and semantic landmarks across the rest of your templates, Netco Design’s accessibility guide offers a practical walkthrough of site-wide basics that pair cleanly with ARIA widget work.

Keyboard Interactions Every Tab List Must Support

Keyboard users rely on predictable key bindings across every tab interface on the web. Your script needs to support the following six keys:

Key Action in the tab list Notes
Tab Moves focus into the active tab, then out to the panel The tab list is a single stop
Right Arrow Moves focus to the next tab Wraps from the last tab to the first
Left Arrow Moves focus to the previous tab Wraps from the first tab to the last
Home Moves focus to the first tab Expected by keyboard users
End Moves focus to the last tab Expected by keyboard users
Enter or Space Activates the focused tab in manual mode Not needed in automatic mode

For a live walkthrough of wiring up these roles, focus states, and keyboard handlers in code, watch this step-by-step build.

Using a headless component library saves you from rewriting roving tabindex and arrow-key wrapping on every project, because the custom element manages those attributes automatically. Even then, inspect the live DOM in DevTools after rendering to confirm your labels, id pairs, and focus styles arrived intact. When everything lines up, someone who has never seen your layout can move through the entire tab set by keyboard alone and hear exactly where they are on every keypress.

Testing Tabs for UK Accessibility Before You Ship

For teams shipping UK public-sector sites and apps, accessible tabs aren’t a nice-to-have polish pass. Under the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018, which came into force on 23 September 2018, covered services must meet WCAG 2.1 AA and publish an accessibility statement, as detailed in GOV.UK digital accessibility guidance. Even on private-sector commercial sites, WCAG 2.2 AA is the practical benchmark that keeps checkout flows, dashboards, and support hubs usable for every customer.

Real-world audits show how frequently keyboard and focus controls still fail in production. In the UK Government’s 2022 to 2024 accessibility monitoring report, assessors reviewed 1,203 public-sector websites and 21 mobile apps, logging 29,787 accessibility issues. Across those monitored websites, 63.6% failed the WCAG 2.1.1 Keyboard criterion and 76.3% failed Focus Visible, with the report highlighting how flawed navigation controls can send keyboard focus wandering invisibly through hidden elements.

Those two failures hit custom tab widgets harder than almost any other component, because a tab set concentrates everything that can go wrong in one small surface: focus order, state announcements, hidden content, and activation behavior. Use the visual checklist below alongside a broader WCAG compliance checklist before any tab interface goes live.

A checklist titled Testing Tabs for UK Accessibility Before You Ship with icons for accessibility compliance.

A Seven-Step Pre-Release Tab Audit

Run through this sequence on every tab widget before merging to production:

  1. Catalogue every tab set on the site. Write down each component’s URL, purpose, and tab count so older marketing pages or account modals don’t slip through untested.
  2. Challenge whether each set should remain tabs. If a tab set hides sequential steps, long articles, or unrelated sections that people compare side by side, convert it into headings, an accordion, or separate pages before spending time debugging ARIA. This single decision removes more accessibility problems than any amount of technical fixing, because no ARIA pattern can rescue content that never belonged in tabs.
  3. Unplug your mouse and test by keyboard alone. Confirm Tab lands on the active tab, arrow keys wrap smoothly, Home and End jump to the edges, and a high-contrast focus indicator stays visible on every single control. Watch closely to verify focus never slips into a hidden panel.
  4. Listen with real screen readers. Test in NVDA and JAWS on Windows, plus VoiceOver on macOS and iOS. Read every element and header, tab through links, check landmarks, and verify each tab label makes sense out of context (“Delivery”, not “More”) and that the active panel is announced clearly when entered. A label that reads well visually often collapses when spoken alone, so this step catches wording problems that sighted reviewers miss.
  5. Verify dynamic updates, touch targets, and ARIA state sync. Switch tabs rapidly, open DevTools, and confirm aria-selected and hidden match the visible panel. Test on a narrow phone screen with touch to ensure labels don’t overlap, scroll cues remain visible, and buttons are large enough to tap cleanly.
  6. Measure real task completion across releases. Ask a colleague or test participant to locate a specific detail buried inside a secondary tab panel, time how long it takes, and repeat that exact task after future releases to catch subtle regressions.
  7. Fix your highest-traffic tab set first. Start on the main product template or primary account page, replace any brittle custom markup with tested primitives (our Components library includes menus, dialogs, tabs and other app primitives), and document the activation mode and mobile layout decision right in the component’s README.

A tab set is ready to ship only when a keyboard-only user and a screen reader user can both find the information inside it without guessing what changed on screen.

One concrete task to finish this week: audit your codebase for any <div> or <span> styled to look like a tab and swap it for a real, ARIA-complete tab component. These impostor elements are the single most common source of tab failures, because they carry no role, no state, and no keyboard behavior at all.


If you’d rather not hand-code roving tabindex, arrow-key wrapping, and panel linking from scratch on every project, DOM Studio provides headless web component primitives and polished Vue wrappers with WAI-ARIA roles, focus management, and keyboard handling built in by default. You get lightweight, tree-shakeable components for tabs, accordions, dialogs, menus, and full app screens so your team can focus on information architecture instead of boilerplate ARIA plumbing. Explore the component library and interactive previews at DOM Studio.