# Tabs

shadcn's tabs (Radix) in Candor's theme.

- Registry name: `tabs` (`@candor/tabs`)
- Tier: Pro. Installing it needs a Pro, Premium or Team licence key: the person runs `npx candor-ui key <key>` themselves; never ask for the key in chat or write it to a file.
- Docs: https://candor.themethodic.com/docs/tabs

## Install

```bash
npx candor-ui add tabs
```

Run `npx candor-ui@latest init` once first (https://candor.themethodic.com/get-started.md). Without the CLI: `npx shadcn@latest add @candor/tabs`.
It brings in: utils.
npm packages: class-variance-authority@^0.7.1, radix-ui@^1.8.1.

## Example

```tsx
"use client"

import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"

export default function Example() {
  return (
    <Tabs defaultValue="plan" className="w-full max-w-md">
      <TabsList>
        <TabsTrigger value="plan">Plan</TabsTrigger>
        <TabsTrigger value="tests">Tests</TabsTrigger>
      </TabsList>
      <TabsContent value="plan" className="rounded-lg border p-3 text-sm">
        Add a nullable region column to customers, backfill it from billing addresses, then add an index.
      </TabsContent>
      <TabsContent value="tests" className="rounded-lg border p-3 text-sm">
        42 passed on Staging, none failed. The backfill took 38 seconds.
      </TabsContent>
    </Tabs>
  )
}
```

## <Tabs>

No props.

Also takes the props of `React.ComponentProps<typeof TabsPrimitive.Root>`.

## <TabsList>

No props.

Also takes the props of `React.ComponentProps<typeof TabsPrimitive.List>`, `VariantProps<typeof tabsListVariants>`.

## <TabsTrigger>

No props.

Also takes the props of `React.ComponentProps<typeof TabsPrimitive.Trigger>`.

## <TabsContent>

No props.

Also takes the props of `React.ComponentProps<typeof TabsPrimitive.Content>`.

## Rules for using Candor UI

- Components take plain typed data. Never pass model output as HTML or render it as a link; messages are typed blocks.
- A control that can't be used says why: wrap it in `<Locked reason="…">`, don't just disable it.
- Don't show a value you don't have: leave it out (it renders as —) rather than guess. An estimate is labelled as one.
- Nothing is pre-selected in a decision a person makes, and the agent is named from your app's data, never from model output.
- Your app's words go in `LocaleProvider` (fixed strings) and `TermsProvider` (nouns); entity kinds and agent roles in `EntityKindsProvider` and `AgentRolesProvider`.
