# Popover

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

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

## Install

```bash
npx candor-ui add popover
```

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

## Example

```tsx
"use client"

import { Button } from "@/components/ui/button"
import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger } from "@/components/ui/popover"

export default function Example() {
  return (
    <Popover>
      <PopoverTrigger asChild>
        <Button variant="outline">What this touches</Button>
      </PopoverTrigger>
      <PopoverContent>
        <PopoverHeader>
          <PopoverTitle>checkout.timeout_ms</PopoverTitle>
          <PopoverDescription>Read by the Checkout API and the payments worker.</PopoverDescription>
        </PopoverHeader>
      </PopoverContent>
    </Popover>
  )
}
```

## <Popover>

No props.

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

## <PopoverTrigger>

No props.

Also takes the props of `React.ComponentProps<typeof PopoverPrimitive.Trigger>`, `RenderProp`.

## <PopoverContent>

No props.

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

## <PopoverAnchor>

No props.

Also takes the props of `React.ComponentProps<typeof PopoverPrimitive.Anchor>`.

## <PopoverHeader>

No props.

Also takes the props of `React.ComponentProps<"div">`.

## <PopoverTitle>

No props.

Also takes the props of `React.ComponentProps<"h2">`.

## <PopoverDescription>

No props.

Also takes the props of `React.ComponentProps<"p">`.

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