# Shadcn Segmented Control

> Segmented control tabs

- Type: example, free and open source (MIT)
- Component: [Tabs](https://reui.io/components/tabs.md)
- Page: https://reui.io/components/tabs/c-tabs-9
- Docs (Base UI): https://ui.shadcn.com/docs/components/base/tabs.md
- Docs (Radix UI): https://ui.shadcn.com/docs/components/radix/tabs.md
- MCP: `get_example("c-tabs-9")`
- Registry item: https://reui.io/r/styles/base-nova/c-tabs-9.json
- Uses: Card, Tabs

## Best for

A controlled Daily to Yearly switch kept in React state, each panel showing one large visitor total

## Agent notes

- The 4 visitor totals are fixed text in each `TabsContent`; read `period` to load the figure for the chosen range

## When not to use

- A period switch that filters data shown elsewhere, with no panel of its own: use [Toggle Group](https://reui.io/components/toggle-group.md) (`get_component("toggle-group")`)
- Panels that hold forms with their own save buttons: use [Basic](https://reui.io/components/tabs/c-tabs-1.md) (`get_example("c-tabs-1")`)

## Install

```bash
npx shadcn@latest add @reui/c-tabs-9
```

## About Shadcn Tabs

### When to use

- Account, password and settings forms split into panels so only one shows at a time
- Side navigation inside a page, with sections stacked in a column beside the open panel
- Views of one surface, such as dashboard sections, mail folders or visitor stats by period

### When not to use

- A finished account settings page with workspace, team and billing sections built in: use the [Profile blocks](https://reui.io/blocks/application/profile.md)
- A metric card whose period switch redraws a plotted trend: use the [Line Chart blocks](https://reui.io/blocks/chart/line-chart.md)
- A project header with a breadcrumb on top and a row of sections with avatars below: use the [Navbar blocks](https://reui.io/blocks/application/navbar.md)

### Agent notes

- Only the active `TabsContent` renders in either twin, so other panels ship no server HTML and lose typed values on a switch
- Arrow keys only move focus across `TabsTrigger` items on the base twin, where Enter or Space selects; radix selects on focus

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
