Skip to content
SkillCodex
Menu

Tabs

Tabs

A set of labels that switches between related content panels while keeping one panel visible at a time.

Try the component
Context, sources and actions
Sources and revision
Updated
Version
v1.0.26 · r2
Sources
5 sources
Status
Published
Read the sources

You may have searched for: switch between overview and activity panelslabels across the top that change contentshow one related view at a time

All phrasings
Save and share

Recognize

Change view or reveal content

Try it

Should the control switch views, choose a compact mode, or reveal content in the flow?

Tabs

Shared trial context

A project workspace reveals related content in place while preserving the user's position on the page.

Tabs

Mission

Tabs

Move focus from Overview to Files with arrow keys, then press Enter to display its panel.

Overview

Project summary and upcoming deadlines.

Live result

The Overview panel is displayed.

Step 1 of 3

Try

Try the component. Your live result appears just above. Move on at your own pace.

Behavior and edge case
What to observe
One selected tab names the visible panel, and the other panels are hidden from interaction.
Edge case
If a panel needs noticeable loading time, activation becomes manual so arrow navigation does not trigger repeated waits.

What this example shows

Tabs control content panels; Segmented control chooses one value, while Accordion reveals sections vertically without replacing one shared panel.

Which fits your need?

Tabs

Grouping a few peer views in one workspace

Segmented control

Switching between a few compact display modes

Which component will you use here?
Difference and sources

Tabs control content panels; Segmented control chooses one value, while Accordion reveals sections vertically without replacing one shared panel.

Read the sources

    Parts of the specimen

    Select a numbered marker on the schematic, or use the list below, to see its role. The schematic shows the concept's representative state.

    Tab list

    The named set that groups the available tabs.

    Position in the atlas

    Relationship map

    Locate the chapter, neighboring concepts, and the next useful decision.

    • Chapter

      Change view or reveal content

      Tabs belongs to this comparison group.

    • Do not confuse

      Segmented control

      Choose Tabs if each option shows its own panel of content within one shared area. Choose Segmented control if the choice is a value, such as a sort order or a unit, that changes how the same content is shown.

      Compare this pair
    • Do not confuse

      Accordion

      Choose Tabs if the views are peers and only one should occupy the space at a time. Choose Accordion if several sections may stay open at once and read top to bottom, like a FAQ.

      Compare this pair
    • Next step

      Compare the concepts in the chapter before choosing an implementation.

      Open the chapter

    In your own words

    Understand

    What people describe

    Documented aliases: tabbed interface, tab bar, panel tabs

    • switch between overview and activity panels
    • labels across the top that change content
    • show one related view at a time
    • a row of tabs above a panel
    • change sections without leaving the page
    • keyboard arrows between content views

    Choose

    Use it when

    • Grouping a few peer views in one workspace
    • Switching instantly between related settings sections

    Avoid it when

    • Users need to compare panels simultaneously
    • Each destination deserves its own URL and page navigation

    Compare

    Compare similar concepts

    Platform equivalents

    The same interaction can have a different name or contract on each platform. Check the mapping before choosing an API.

    • HTML

      No direct primitive

      No direct primitive

      HTML has no tabs element; buttons, panels, state, focus movement, and hiding behavior must be composed.

      Verified
    • WAI-ARIA APG

      Direct

      tablist + tab + tabpanel roles

      WAI-ARIA APG 2026-09

      The pattern defines role relationships, one tab stop, arrow navigation, selection, and panel visibility.

      Verified Official documentation
    • Radix UI

      Direct

      Tabs.Root

      @radix-ui/react-tabs 1.1.x

      The primitive coordinates the tab list, triggers, panels, keyboard orientation, activation, and state.

      Verified Official documentation
    • shadcn/ui

      Direct

      Tabs

      shadcn/ui docs 2026-09-03

      The Tabs recipe exposes the Radix tabs behavior with local styling.

      Verified Official documentation
    • Material UI

      Direct

      Tabs + Tab

      Material UI v9.4.0

      Tabs manages selection and indicators; the application associates and renders each tab panel.

      Verified Official documentation
    • SwiftUI

      Direct

      TabView

      SwiftUI documentation 2026-09

      TabView switches among selected child views and adapts its tab presentation to the platform.

      Verified Official documentation
    • Jetpack Compose

      Direct

      Tab + PrimaryTabRow

      Android Developers 2026-08

      Tab rows present related destinations while application state selects and renders the matching content.

      Verified Official documentation
    • Flutter

      Direct

      TabBar + TabBarView

      Flutter API docs 2026-09

      TabBar and TabBarView share a controller to synchronize selection, keyboard or gesture navigation, and panels.

      Verified Official documentation

    Impact profile

    Measured implementation costs and operating constraints for this SkillCodex specimen. A missing evaluation is never treated as free.

    Rendering
    Client
    Lazy weight
    11.4 kB-gzip
    Measured ·
    Environment
    macOS 26.6.2; Node 24.19.0; pnpm 10.34.5; Next.js 16.3.0 Turbopack; Chromium 140
    Method
    Sum of gzip -9 bytes for the lazy files of module 26189 in .next/server/app/(en)/term/[slug]/page/react-loadable-manifest.json after pnpm build:local at c9f1299.
    Low-end devices
    Fine
    Measured ·
    Environment
    macOS 26.6.2; Node 24.19.0; pnpm 10.34.5; Next.js 16.3.0 Turbopack; Chromium 140
    Method
    Loaded the 390 x 844 term route in isolated Chromium with 6x CPU throttling and reduced motion, then exercised the first state change; failures are recorded as non-blocking warnings.
    CPU / GPU
    Radix and React switch peer DOM panels; no canvas, WebGL or continuous animation path is present.
    Measured ·
    Environment
    macOS 26.6.2; Node 24.19.0; pnpm 10.34.5; Next.js 16.3.0 Turbopack; Chromium 140
    Method
    Static source inspection of the target lab module plus an interaction on the isolated Chromium verification route; checked DOM/React work and absence of canvas or WebGL.
    Reduced motion
    The global reduced-motion contract collapses animation and transition durations; the same states and controls remain available.
    Measured ·
    Environment
    macOS 26.6.2; Node 24.19.0; pnpm 10.34.5; Next.js 16.3.0 Turbopack; Chromium 140
    Method
    Inspected src/app/globals.css prefers-reduced-motion rules and repeated the target interaction with reducedMotion=reduce in Chromium.
    Static fallback
    Without JavaScript, the term route stays on its localized Loading fallback; the profile and initial specimen are not revealed.
    Measured ·
    Environment
    macOS 26.6.2; Node 24.19.0; pnpm 10.34.5; Next.js 16.3.0 Turbopack; Chromium 140
    Method
    Loaded all ten prerendered routes from a local next start build in Chromium with JavaScript disabled; each HTTP 200 remained on the localized Loading fallback, so the profile and specimen were not revealed.
    Server rendering
    Hydrates
    Measured ·
    Environment
    macOS 26.6.2; Node 24.19.0; pnpm 10.34.5; Next.js 16.3.0 Turbopack; Chromium 140
    Method
    Inspected the prerendered route response, then loaded the same route with JavaScript enabled and exercised the hydrated client specimen.
    Maintenance
    Stable

    Good fit

    • A small set of peer sections where exactly one panel is visible.

    Avoid when

    • Independent expandable sections or a linear multi-step process.

    Verification checklist

    Try these actions in the lab, then check the same behaviours in your agent’s result. Adapt the example names to your interface.

    1. 1. Do this

      Select another tab and inspect the content below it.

      Expected result

      Exactly one peer panel is displayed, and the selected tab identifies the panel it controls.

    2. 2. Do this

      Reach the tab list with Tab and move with the arrow keys; use Enter or Space if activation is manual.

      Expected result

      Focus moves among tabs. The selected panel changes according to the announced automatic or manual activation model.

    3. 3. Do this

      Press Tab from the selected tab, read the displayed panel, then continue with Tab; use its links or controls if it contains any.

      Expected result

      The displayed panel is reachable and readable; any controls follow a logical order, and hidden panels add no invisible stops.

    Full contract
    1. 1Every tab controls exactly one panel
    2. 2Only one peer panel is presented at a time
    3. 3Arrow and activation behavior is documented
    4. 4Slow panels use manual activation

    Understand → Recognize → Choose → Compare

    Pack for your agent

    Pre-written instructions to paste into your agent. Copying executes nothing.

    Implement correctly

    Build Tabs without breaking its behavior

    # Implement Tabs in your agent
    
    ## Objective
    Implement Tabs for this verified behavior: A set of labels that switches between related content panels while keeping one panel visible at a time.
    
    ## Prerequisites
    - Inspect the repository, design system, and existing tests first.
    - Preserve unrelated changes and keep the file scope bounded.
    - Confirm that Tabs matches the need before writing code.
    
    ## Required behavior
    - The selected tab exposes its associated panel while the other panels are hidden.
    - Arrow keys move through related items according to their visual orientation.
    
    ## States to cover
    - Overview tab selected
    - Files tab selected
    
    ## Accessibility
    - ARIA role: tablist > tab + tabpanel
    - The primary control or named region for Tabs has a stable accessible name from visible text or an explicit programmatic label; placeholder text and tooltips are not names.
    - The tab list is one tab stop; the visible panel is reachable in normal document order when it contains focusable content.
    - Not applicable: selecting another tab replaces the visible panel without closing the component.
    - Selected state and the relationship between each tab and its named panel are exposed.
    - Tab enters the selected tab
    - Arrow keys move between tabs
    - Enter or Space activates in manual mode
    - Home and End reach the first and last tab
    
    ## When not to use
    - Users need to compare panels simultaneously
    - Each destination deserves its own URL and page navigation
    
    ## Acceptance criteria
    - Every tab controls exactly one panel
    - Only one peer panel is presented at a time
    - Arrow and activation behavior is documented
    - Slow panels use manual activation
    
    ## Guardrails
    - Show the proposed changes before any external action.
    - Do not publish, send, delete, pay for, or change remote state without explicit authorization.
    - Preserve unrelated changes and stop if the scope becomes ambiguous.
    
    ## Output format
    - Outcome or verdict.
    - Files or actions involved.
    - Checks run and observable evidence.
    - Remaining blockers or limitations.
    
    • @radix-ui/react-tabs
    • Requires · Access to the repository, design system, and tests
    Why it works
    • The need is tied to canonical behavior before any technical choice.
    • States, accessibility, and non-goals prevent a merely visual implementation.
    • Acceptance criteria and the output format make verification observable.

    Try next

    Verify Tabs on a real journey

    # Verify Tabs after implementation
    
    ## Objective
    Audit the Tabs implementation against its behavior, states, and accessibility requirements without changing it automatically.
    
    ## Checks
    - Replay the smallest representative journey.
    - Check keyboard behavior, focus, accessible name, and announcements.
    - Tie each gap to a specific acceptance criterion.
    
    ## Guardrails
    - Show the proposed changes before any external action.
    - Do not publish, send, delete, pay for, or change remote state without explicit authorization.
    - Preserve unrelated changes and stop if the scope becomes ambiguous.
    
    ## Output format
    - Outcome or verdict.
    - Files or actions involved.
    - Checks run and observable evidence.
    - Remaining blockers or limitations.
    

    sha256:0d11cfd83f56f5d408108b8dc5e118b801fbe00da1c4741476df6eba9c9a8f82

    Diagnose a problem

    Find and fix the Tabs defect

    # Debug Tabs in your agent
    
    ## Observed symptom
    [DESCRIBE THE SYMPTOM HERE]
    
    ## Observable checks
    - Reproduce the issue with the smallest relevant journey.
    - Compare behavior with the documented states and transitions for Tabs.
    - Verify keyboard behavior, focus, accessible name, and announcements.
    
    ## Possible causes
    - The chosen primitive does not match the expected behavior.
    - A state, transition, or focus return is missing.
    - A neighboring component captures an event or hides an accessible signal.
    
    ## Bounded corrections
    - Fix the reproduced cause without recreating neighboring components.
    - Preserve the public contract and add a focused regression test.
    - Do not install dependencies or change remote state without authorization.
    
    ## Final verification
    - Every tab controls exactly one panel
    - Only one peer panel is presented at a time
    - Arrow and activation behavior is documented
    - Slow panels use manual activation
    
    ## Guardrails
    - Show the proposed changes before any external action.
    - Do not publish, send, delete, pay for, or change remote state without explicit authorization.
    - Preserve unrelated changes and stop if the scope becomes ambiguous.
    
    ## Output format
    - Outcome or verdict.
    - Files or actions involved.
    - Checks run and observable evidence.
    - Remaining blockers or limitations.
    
    • @radix-ui/react-tabs
    • Requires · Access to the repository, design system, and tests
    Why it works
    • The explicit symptom prevents starting from an assumed fix.
    • Checks separate behavior, accessibility, and neighboring interference.
    • The fix stays bounded and must produce regression evidence.

    Try next

    Lock in the Tabs fix

    # Prevent the Tabs regression
    
    ## Objective
    Turn the reproduced cause into a focused regression test and compare Tabs with neighboring concepts before widening the fix.
    
    ## Checks
    - Prove that the test fails before the fix.
    - Prove that it passes after the bounded fix.
    - Verify that no neighboring component changed behavior.
    
    ## Guardrails
    - Show the proposed changes before any external action.
    - Do not publish, send, delete, pay for, or change remote state without explicit authorization.
    - Preserve unrelated changes and stop if the scope becomes ambiguous.
    
    ## Output format
    - Outcome or verdict.
    - Files or actions involved.
    - Checks run and observable evidence.
    - Remaining blockers or limitations.
    

    sha256:7649dbb115cecfdc196f1eb5ec638464f4294f133578f47344cf9f19c664b201

    Full entry, saving and provenance

    Pre-written instruction by SkillCodex — your request is neither sent nor used to adapt this text; no content is generated, and copying executes nothing.

    Pack digest: sha256:388f7679bff18368c7b1d995f565b7f9ccf0bf6101781a4be0f598e330d08269

    In code

    TechnologyPrimitiveVersionCaveat
    @radix-ui/react-tabs

    Tabs.Root

    @radix-ui/react-tabs@1.1.17Choose manual or automatic activation according to panel latency and test the matching keyboard behavior.

    Technical details

    Behaviors

    • Activate a panel

      The selected tab exposes its associated panel while the other panels are hidden.

    • Navigate with arrows

      Arrow keys move through related items according to their visual orientation.

    States

    • Overview tab selected

      Overview tab selected

    • Files tab selected

      Files tab selected

    State transitions

    • Overview tab selected → Files tab selected

      Arrow navigation reaches Files and automatic or explicit activation reveals its panel.

    • Files tab selected → Overview tab selected

      Arrow navigation reaches Overview and automatic or explicit activation reveals its panel.

    Test scenarios

    Context
    A project page groups Overview, Activity, and Files in one fast local workspace.
    Mission
    Move focus from Overview to Files with arrow keys, then press Enter to display its panel.
    Primary state
    One selected tab names the visible panel, and the other panels are hidden from interaction.
    Edge case
    If a panel needs noticeable loading time, activation becomes manual so arrow navigation does not trigger repeated waits.

    Visual signals

    • Horizontal or vertical tab list
    • One selected tab
    • One associated content panel

    Behavioral signals

    • Arrow keys move between tabs
    • Selection reveals the matching panel
    • Activation may be automatic only when panels load instantly

    Accessibility

    Role
    tablist > tab + tabpanel
    Accessible name
    The primary control or named region for Tabs has a stable accessible name from visible text or an explicit programmatic label; placeholder text and tooltips are not names.
    Focus
    The tab list is one tab stop; the visible panel is reachable in normal document order when it contains focusable content.
    Dismissal
    Not applicable: selecting another tab replaces the visible panel without closing the component.
    Scroll
    Changing the active view preserves a stable page position. Focus remains on the controlling item and newly revealed content does not cause an unexpected jump.
    Announcement
    Selected state and the relationship between each tab and its named panel are exposed.
    Keyboard
    • Tab enters the selected tab
    • Arrow keys move between tabs
    • Enter or Space activates in manual mode
    • Home and End reach the first and last tab

    Bindings

    Open the HTML, ARIA, Radix, and shadcn matrix
    • Tabs.Root

      implementationKind
      radix
      nativeElement
      Not applicable
      ariaPattern
      tabs
      radixPrimitive
      Tabs
      shadcnRecipe
      Tabs
      runtimeDependency
      @radix-ui/react-tabs@1.1.17
      packageName
      @radix-ui/react-tabs
      exportName
      Tabs.Root
      exactVersion
      1.1.17
      status
      verified
      sourceId
      source-ui-radix-tabs
      deprecationStatus
      active
      replacement
      Not applicable
      validFrom
      Not applicable
      validUntil
      Not applicable

      Equivalence caveat: Choose manual or automatic activation according to panel latency and test the matching keyboard behavior.

      Verify binding source

    Sources

    • WAI-ARIA APG: Tabs Pattern
      sourceId
      source-ui-aria-tabs
      kind
      documentation
      canonicalUrl
      https://www.w3.org/WAI/ARIA/apg/patterns/tabs/
      publisher
      W3C WAI
      sourceRevision
      http-last-modified:2026-07-09T07:07:35Z
      consultedAt
      2026-07-19
      license
      Not stated
      contentDigest
      sha256:1953e8ee2c1e6200a637cdd9de23ac0ab198ea98e6bc9e4a46b0a75702306c86
      status
      verified

      Claim covered: Tabs: informative APG guidance for the tabs pattern: roles, states, relationships, and keyboard interaction.

    • Radix Primitives: Tabs
      sourceId
      source-ui-radix-tabs
      kind
      documentation
      canonicalUrl
      https://www.radix-ui.com/primitives/docs/components/tabs
      publisher
      Radix Primitives
      sourceRevision
      http-etag:W/"601b796621807b6969083b7ce12ce5d6"
      consultedAt
      2026-07-19
      license
      Not stated
      contentDigest
      sha256:0e6235ee3c1800e791b35bacce63be07a6a06d3f9f56255b0e550d3c65d93094
      status
      verified

      Claim covered: Tabs: documented parts, state APIs, interaction behavior, and implementation limits for Radix Tabs.

    • WAI-ARIA 1.2: Roles Model
      sourceId
      source-ui-wai-aria-roles
      kind
      standard
      canonicalUrl
      https://www.w3.org/TR/wai-aria-1.2/#roles
      publisher
      W3C WAI
      sourceRevision
      W3C-REC-wai-aria-1.2-20230606
      consultedAt
      2026-07-19
      license
      Not stated
      contentDigest
      sha256:c0fea16fc747779569ab754d2d25bca3e2b7e8a673b8ef5362aeb9ebc73a4849
      status
      verified

      Claim covered: Tabs: normative ARIA role definitions and constraints for the stated accessible role.

    • WCAG 2.2: Focus Appearance
      sourceId
      source-ui-wcag-understanding-focus-appearance
      kind
      documentation
      canonicalUrl
      https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance.html
      publisher
      W3C WAI
      sourceRevision
      http-last-modified:2026-07-02T10:07:49Z
      consultedAt
      2026-07-19
      license
      Not stated
      contentDigest
      sha256:fdcf316a1f0e3cc758eda9618322d132862124ff0a3f3b1a3acbf20daf804ff0
      status
      verified

      Claim covered: Tabs: informative WCAG guidance for evaluating visible keyboard focus appearance.

    • WAI-ARIA APG: Button Pattern
      sourceId
      source-ui-aria-button
      kind
      documentation
      canonicalUrl
      https://www.w3.org/WAI/ARIA/apg/patterns/button/
      publisher
      W3C WAI
      sourceRevision
      http-last-modified:2026-07-09T07:07:36Z
      consultedAt
      2026-07-19
      license
      Not stated
      contentDigest
      sha256:863329ea659a53439b0953eec0bd0af7c6219e372d0e878f75e57d263924704c
      status
      verified

      Claim covered: Tabs: informative APG guidance for the button pattern: roles, states, relationships, and keyboard interaction.