Skip to content

Navigation

Tabs

Also calledtabbed interfacetab strip

A row of controls that switches between related panels, showing one panel at a time without leaving the page.

How people describe it

  • “row of labels that switch the content below”
  • “one highlighted label above a changing panel”
  • “click a heading to swap between views”

Good for

  • Related settings sections
  • Different views of the same information

Don’t mix it up with

  • Expands sections in place and can show several sections at once.

What your library calls it

LIBRARYCALLS IT
shadcn/uiTabs

Accessibility checklist

  • Label the tab list and associate tabs with panels
  • Support arrow keys, Home and End
  • Expose selected state and keep keyboard focus visible

Try it

Overview

Only one panel is visible at a time. Use the arrow keys, Home, and End to move between tabs.

Click a tab, or use the arrow keys, Home, and End.

Prompt

Add tabs that show one panel at a time and support arrow-key navigation.

~18 estimated prompt tokensDetailed: ~56 estimated prompt tokens

Rough estimate for prompt text only; actual counts vary by model and context.

"use client";
// Requires the shadcn/ui tabs component in the consuming project.
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs";

export function ProjectTabs() {
  return (
    <Tabs defaultValue="summary">
      <TabsList aria-label="Project views" className="h-auto flex-wrap">
        <TabsTrigger value="summary" className="min-h-11 min-w-11">Summary</TabsTrigger>
        <TabsTrigger value="activity" className="min-h-11 min-w-11">Activity</TabsTrigger>
      </TabsList>
      <TabsContent value="summary">Project summary</TabsContent>
      <TabsContent value="activity">Recent activity</TabsContent>
    </Tabs>
  );
}

Used in

Explore website blueprints that use this component.