# Surface

Candor's card: a plain, muted, bordered or floating surface, so no screen hand-rolls its own.

- Registry name: `surface` (`@candor/surface`)
- Tier: Free (MIT). No licence key needed.
- Docs: https://candor.themethodic.com/docs/surface

## Install

```bash
npx candor-ui add surface
```

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

## Example

```tsx
"use client"

import { Surface } from "@/components/surface"

export default function Example() {
  return (
    <div className="grid gap-3 sm:grid-cols-3">
      {(["plain", "muted", "raised"] as const).map((tone) => (
        <Surface key={tone} tone={tone} className="h-20">
          <p className="text-sm font-medium capitalize">{tone}</p>
        </Surface>
      ))}
    </div>
  )
}
```

## <Surface>

No props.

Also takes the props of `React.ComponentProps<"div">`, `VariantProps<typeof surfaceVariants>`.

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