Pilipinas Interface

Foundation

  • Overview
  • Get Started
  • Colors
  • Typography
  • Icons
  • Layout & Spacing
  • States & Feedback
  • Motion & Transitions
  • Expressions

Components

  • Overview
  • Accordion
  • Alert
  • Avatar
  • Badge
  • Banner
  • Breadcrumb
  • Button
  • Card
  • Checkbox
  • Code Block
  • Combobox
  • Command Menu
  • Dialog
  • Popover
  • Progress
  • Radio Group
  • Scroll Area
  • Select
  • Skeleton
  • Switch
  • Table
  • Tabs
  • Text Field
  • Tooltip

Resources

  • Registry

Components

Tabs

Section navigation for peer views of one object. A shared pill slides between items; the selected panel follows immediately.

Preview

Applicant name, reference number and submission date.

<Tabs selectedIndex={index} onSelect={setIndex} idPrefix="details">
  <TabsItem index={0} label="Details" />
  <TabsItem index={1} label="Requirements" />
</Tabs>
<TabsPanel index={0} selectedIndex={index} idPrefix="details">Details here.</TabsPanel>

Usage

Two to five peer views of the same record.

Do and don't

  • Do. Share one idPrefix between the list and its panels.
  • Don't. Use them for steps in a transaction or page-level navigation.

Composition

Tabs owns the tab list; TabsItem is one tab. TabsPanel is rendered outside the root and links back through a shared idPrefix. Keep the prefix unique per instance on a page.

Props

  • Tabs: controlled selectedIndex + onSelect, idPrefix, activeLabel, size.
  • TabsItem: index, required label, optional icon.
  • TabsPanel: index, selectedIndex, idPrefix.

Behavior and states

The active pill and any collapsing label animate on selection. With activeLabel, only the selected tab shows its text, so every item needs an icon. Panels render only for the selected index; there is no hidden panel left in the tab order.

Accessibility

Base UI provides the tablist, tab and tabpanel roles and arrow-key movement. The panel stays associated with its tab through the shared prefix even though it is rendered outside the root. Keep tab labels short and meaningful; do not nest a tab inside another interactive control.

Responsive

activeLabel is the compact form for narrow panels. The list follows the shared size context; set size on the root to pin a region to the 28px step.

Related

Breadcrumb shows where you are, Table holds ledgers, and Layout & Spacing covers the size ladder these tabs inherit.

← PreviousTableNext →Text Field

Install

npx shadcn@latest add @pilipinas/tabs

For your coding agent