# Tabs (Andromeda Pro)

Tabs is a component of the Premium Andromeda Pro design system from AI Canvas (https://aicanvas.me). Index of every system, component and install setup: https://aicanvas.me/llms.txt

Splits content into named panels and shows one at a time, as a row of tabs or a list whose rows can each carry a sentence.

- Design system: [Andromeda Pro](https://aicanvas.me/design-systems/andromeda-pro.md)
- License: Premium (proprietary)
- Install slug: `andromeda-pro-tabs`
- Page: https://aicanvas.me/design-systems/andromeda-pro/tabs

## Install

```bash
npx shadcn@latest add @aicanvas/andromeda-pro-tabs
```

Requires Premium. Without a Premium token the command writes a placeholder (a `PremiumLocked` notice) instead of the component.

Every Andromeda Pro component at once: `npx shadcn@latest add @aicanvas/andromeda-pro`.

Token setup: the Install section of https://aicanvas.me/llms.txt.

## Use it

It installs to `components/aicanvas/andromeda-pro/components/Tabs.tsx` (under `src/` if your project has one). With the usual `@/` alias:

```tsx
import { Tabs } from '@/components/aicanvas/andromeda-pro/components/Tabs'
```

## Example

```tsx
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/aicanvas/andromeda-pro/components/Tabs'

<Tabs defaultValue="details">
  <TabsList aria-label="Invoice sections">
    <TabsTrigger value="details">Details</TabsTrigger>
    <TabsTrigger value="activity">Activity</TabsTrigger>
  </TabsList>
  <TabsContent value="details">
    Payment is due on November 30.
  </TabsContent>
  <TabsContent value="activity">
    The invoice was sent today.
  </TabsContent>
</Tabs>
```

## Parts

Tabs is built from `Tabs`, `TabsList`, `TabsTrigger` and `TabsContent`. Each part has its own props table below.

## Variants

- `orientation` on `Tabs`: horizontal or vertical (default 'horizontal')
- `size` on `Tabs`: sm, md or lg (default 'md')

## Props

### Tabs

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value?` | `string` |  | Controlled selected value; pair with `onValueChange`. |
| `defaultValue?` | `string` |  | Initial value when uncontrolled. |
| `onValueChange?` | `(value: string) => void` |  | Called with the value of the tab picked. |
| `orientation?` | `'horizontal'\|'vertical'` | `'horizontal'` | Horizontal: a row on the control ladder with the accent edge along the bottom. Vertical: a list of rows with hairlines between, the accent edge on the left, and room for a description per row. |
| `size?` | `'sm'\|'md'\|'lg'` | `'md'` | Horizontal only: the rung on the shared control ladder (28, 32 or 40px tall; 12, 14 or 16px type), so a tab row sits level with the Buttons beside it. |

### TabsList

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `aria-label` | `string` |  | Names the list for assistive tech (or use aria-labelledby). |

### TabsTrigger

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `string` |  | The value this tab selects. |
| `children` | `React.ReactNode` |  | The tab's label. |
| `leading?` | `React.ReactNode` |  | A short mark before the label: an index ("01") or an icon. Faint at rest, primary when hovered or picked. |
| `description?` | `React.ReactNode` |  | Vertical only: a sentence under the label, muted at rest, secondary when hovered or picked. |
| `disabled?` | `boolean` |  | When true, disables the control. |

### TabsContent

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `string` |  | The value whose panel this is. Only the selected value's panel is mounted. |

## Remix prompt

Only when the user wants Tabs rebuilt from scratch instead of installed: the public part of its remix prompt is in the Remix panel at https://aicanvas.me/design-systems/andromeda-pro/tabs.

## More Andromeda Pro components

- [Tag](https://aicanvas.me/design-systems/andromeda-pro/tag.md)
- [Textarea](https://aicanvas.me/design-systems/andromeda-pro/textarea.md)
- [Toggle](https://aicanvas.me/design-systems/andromeda-pro/toggle.md)
- [Tool](https://aicanvas.me/design-systems/andromeda-pro/tool.md)
- [Tooltip](https://aicanvas.me/design-systems/andromeda-pro/tooltip.md)
