---
title: "Expandable Tabs"
description: "Icon tabs whose active tab grows to show its name on one moving pill. Add the optional popup parts and the bar morphs into a panel."
url: https://gelatinui.com/components/expandable-tabs
markdown_url: https://gelatinui.com/components/expandable-tabs.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/expandable-tabs"
version: "2026-11-09"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Expandable Tabs

> Icon tabs whose active tab grows to show its name on one moving pill. Add the optional popup parts and the bar morphs into a panel.

Page: https://gelatinui.com/components/expandable-tabs

## When to use it

Best for: A small icon bar of views or tools where the open one names itself, with an optional panel that grows from the bar.

- Use it when the bar has 3 to 6 views with clear icons, and room is short.
- Add `ExpandableTabsPopup` when each tab opens a small panel of choices over the page.
- Use `fullWidth` for a phone tab bar that fills the row.

## When not to use it

- For text tabs that all show their names, use [Tabs](https://gelatinui.com/components/tabs.md).
- For a single choice of a value, not a view, use a [Segmented Control](https://gelatinui.com/components/segmented-control.md).
- For a vertical column of icons, use a [Sidebar](https://gelatinui.com/components/sidebar.md).

## Notes for agents

- Each `ExpandableTabsTrigger` needs a `value`, an `ExpandableTabsIcon`, and an `ExpandableTabsLabel`. The label is the accessible name.
- Give `ExpandableTabsList` an `aria-label` that names the bar.
- The popup parts are optional. Wrap the list in `ExpandableTabsPopup`, then put `ExpandableTabsPopupPanels` with one `ExpandableTabsPopupPanel` per tab after the list.
- With the popup, use `defaultValue={null}` for a closed bar. The value is `null` when the popup closes.
- Without the popup, use `ExpandableTabsContent` for the panel of each tab.
- `side` on the popup is `top` (a bar at the bottom of the screen) or `bottom`.
- Horizontal only: `orientation` is not a prop.

## Anatomy

```text
ExpandableTabs
├─ ExpandableTabsList (0..n)
├─ ExpandableTabsTrigger (0..n)
├─ ExpandableTabsIcon (0..n)
├─ ExpandableTabsLabel (0..n)
├─ ExpandableTabsContent (0..n)
├─ ExpandableTabsPopup (0..n)
├─ ExpandableTabsPopupPanels (0..n)
└─ ExpandableTabsPopupPanel (0..n)
```

## API reference

### ExpandableTabs

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `onValueChange` | `function` |  | Called with the next value: a tab press (the Base UI details), a close of the Expandable Tabs Popup (`escape-key`, `outside-press`, `trigger-press`, value `null`), or the fallback of an uncontrolled root (`missing`, `disabled`). Call `details.cancel` on Base UI details to keep the value. |

Also takes every prop of Base UI `Tabs.Root`: https://base-ui.com/react/components/tabs

### ExpandableTabsList

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `fullWidth` | `boolean` | false |  |
| `rounded` | `"default" \| "full"` | "full" |  |
| `size` | `"default" \| "lg" \| "sm"` | "default" |  |
| `variant` | `"default" \| "ghost"` |  |  |
| `className` | `string` |  |  |
| `expandOnHover` | `boolean` | false | Grow a tab while the mouse is over it too, not only the active one (default `false`). The other tabs slide while you aim, so the default shows the name in a Tooltip instead. |

Also takes every prop of Base UI `Tabs.List`: https://base-ui.com/react/components/tabs

### ExpandableTabsTrigger

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `value` | `any` |  | The value of the tab (required: the root matches it, and the popup panel with it). |
| `children` | `ReactNode` |  | An `ExpandableTabsIcon` (16px; it stays in one place while the tab grows) and an `ExpandableTabsLabel` with the name of the tab: shown next to the icon when active, in the Tooltip when not, and always its accessible name. |

Also takes every prop of Base UI `Tabs.Tab`: https://base-ui.com/react/components/tabs

### ExpandableTabsIcon

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### ExpandableTabsLabel

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### ExpandableTabsContent

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `gap` | `"default" \| "none"` |  | The space between the list and the panel: `default` (12px) or `none`, for a panel that sits flush under a list in a head with its own edge (the JSX Preview stage). |

Also takes every prop of Base UI `Tabs.Panel`: https://base-ui.com/react/components/tabs

### ExpandableTabsPopup

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `side` | `ExpandableTabsPopupSide` | "top" | The side of the bar where the panel grows: `top` (default, a bar at the bottom of a screen) or `bottom` (a bar at the top). |

### ExpandableTabsPopupPanels

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### ExpandableTabsPopupPanel

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Tabs.Panel`: https://base-ui.com/react/components/tabs

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| ExpandableTabs | `expandable-tabs` |  |  |  |
| ExpandableTabsList | `expandable-tabs-list` | `data-rounded`, `data-size`, `data-variant` | `--radius` | `hit-area` |
| ExpandableTabsTrigger | `expandable-tabs-trigger` | `data-active`, `data-disabled`, `data-full-width`, `data-pill`, `data-rounded`, `data-size`, `data-variant` | `--expandable-tabs-grow`, `--expandable-tabs-open`, `--expandable-tabs-tone`, `--radius` | `hit-area` |
| ExpandableTabsIcon | `expandable-tabs-icon` | `data-size` | `--expandable-tabs-tone`, `--foreground`, `--muted-foreground` | `motion-timing` |
| ExpandableTabsLabel | `expandable-tabs-label` | `data-size` | `--expandable-tabs-label-width`, `--expandable-tabs-open`, `--expandable-tabs-tone`, `--foreground`, `--muted-foreground` |  |
| ExpandableTabsContent | `expandable-tabs-content` |  |  |  |
| ExpandableTabsPopup | `expandable-tabs-popup` | `data-rounded`, `data-size` | `--expandable-tabs-popup-radius` |  |
| ExpandableTabsPopupPanels | `expandable-tabs-popup-panels` |  | `--expandable-tabs-popup-radius` |  |
| ExpandableTabsPopupPanel | `expandable-tabs-popup-panel` |  | `--expandable-tabs-popup-radius` |  |

## Usage

Each trigger shows an icon, and the selected one opens its label. Add the popup parts when a tab opens a panel.

```tsx title="app-tabs.tsx"
import { HouseIcon, MagnifyingGlassIcon, TrayIcon } from "@phosphor-icons/react/ssr";

import {
  ExpandableTabs,
  ExpandableTabsIcon,
  ExpandableTabsLabel,
  ExpandableTabsList,
  ExpandableTabsTrigger,
} from "@/components/pro/navigation/expandable-tabs";

export function AppTabs() {
  return (
    <ExpandableTabs defaultValue="home">
      <ExpandableTabsList aria-label="Sections">
        <ExpandableTabsTrigger value="home">
          <ExpandableTabsIcon><HouseIcon /></ExpandableTabsIcon>
          <ExpandableTabsLabel>Home</ExpandableTabsLabel>
        </ExpandableTabsTrigger>
        <ExpandableTabsTrigger value="search">
          <ExpandableTabsIcon><MagnifyingGlassIcon /></ExpandableTabsIcon>
          <ExpandableTabsLabel>Search</ExpandableTabsLabel>
        </ExpandableTabsTrigger>
        <ExpandableTabsTrigger value="inbox">
          <ExpandableTabsIcon><TrayIcon /></ExpandableTabsIcon>
          <ExpandableTabsLabel>Inbox</ExpandableTabsLabel>
        </ExpandableTabsTrigger>
      </ExpandableTabsList>
    </ExpandableTabs>
  );
}
```

## Compose

Rules:

- Touch targets (`touch-targets`): Give every control a hit area of at least 44 px on touch screens, even when it looks smaller.
- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/expandable-tabs
```

It adds 36 registry items: 33 files, 6155 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`, `xstate`.

## Built on

- [Tabs](https://gelatinui.com/components/tabs.md)
- [Tooltip](https://gelatinui.com/components/tooltip.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Tabs](https://gelatinui.com/components/tabs.md)
- [Segmented Control](https://gelatinui.com/components/segmented-control.md)
- [Toolbar](https://gelatinui.com/components/toolbar.md)
- [Tooltip](https://gelatinui.com/components/tooltip.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Arrow Left, Arrow Right | Moves focus to the next tab. Without the popup, it also shows that view. |
| Home, End | Moves focus to the first or the last tab. |
| Enter, Space | Opens the focused tab. A second press on the active tab closes the popup. |
| Escape | Closes the popup and puts focus on the active tab. |

## Motion

| Part | Motion |
| --- | --- |
| Tab grow | island · the label clip opens to the label width, and the tabs after it slide in the same frames |
| Pill | island · one pill follows the active tab on the same spring |
| Popup surface | island · the surface grows from the bar edge to the panel size |
| Panel switch | island · the new panel moves in 12px from the side of the new tab, from 96% scale and a 2px blur |
| Icon press | press · the icon scales to 0.92 |
