# Scroll area

shadcn's scroll area (Radix) in Candor's theme.

- Registry name: `scroll-area` (`@candor/scroll-area`)
- 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/scroll-area

## Install

```bash
npx candor-ui add scroll-area
```

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

## Example

```tsx
"use client"

import * as React from "react"
import { ScrollArea } from "@/components/ui/scroll-area"
import { Separator } from "@/components/ui/separator"

const migrations = Array.from({ length: 24 }, (_, i) => `0${142 - i} ${["add_region_to_customers", "drop_partner_tier_old", "index_invoices_due_at", "add_flag_owner"][i % 4]}`)

export default function Example() {
  return (
    <ScrollArea className="h-64 w-72 rounded-lg border">
      <div className="p-3">
        <h4 className="mb-2 text-sm font-medium">Migrations on Staging</h4>
        {migrations.map((m) => (
          <React.Fragment key={m}>
            <p className="font-mono text-xs">{m}</p>
            <Separator className="my-2" />
          </React.Fragment>
        ))}
      </div>
    </ScrollArea>
  )
}
```

## <ScrollArea>

No props.

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

## <ScrollBar>

No props.

Also takes the props of `React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>`.

## 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`.
