# Avatar

shadcn's avatar in Candor's theme.

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

## Install

```bash
npx candor-ui add avatar
```

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

## Example

```tsx
"use client"

import { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount } from "@/components/ui/avatar"

export default function Example() {
  return (
    <div className="flex flex-wrap items-center gap-6">
      <Avatar size="lg">
        <AvatarFallback>PR</AvatarFallback>
        <AvatarBadge>
          <span className="sr-only">Online</span>
        </AvatarBadge>
      </Avatar>
      <AvatarGroup role="group" aria-label="Reviewers: Priya, Dana, Jonas and 2 more">
        <Avatar>
          <AvatarFallback>P</AvatarFallback>
        </Avatar>
        <Avatar>
          <AvatarFallback>D</AvatarFallback>
        </Avatar>
        <Avatar>
          <AvatarFallback>J</AvatarFallback>
        </Avatar>
        <AvatarGroupCount>+2</AvatarGroupCount>
      </AvatarGroup>
    </div>
  )
}
```

## <Avatar>

Props:

- `size?: "default" | "sm" | "lg" | undefined` (default `"default"`): 32px by default; sm is 24px, lg 40px.

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

## <AvatarImage>

No props.

Also takes the props of `React.ComponentProps<typeof AvatarPrimitive.Image>`.

## <AvatarFallback>

No props.

Also takes the props of `React.ComponentProps<typeof AvatarPrimitive.Fallback>`.

## <AvatarBadge>

No props.

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

## <AvatarGroup>

No props.

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

## <AvatarGroupCount>

No props.

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

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