<!-- Generated by scripts/gen-docs.mts from the JSDoc in registry/. Do not edit; run `pnpm run docs`. -->

# RingCard

An incoming call, with the caller and the person's choice of audio, video or decline.

## Install

Once per app, with Tailwind CSS v4 and an `@/*` path alias (skip `init` in an existing shadcn app), then the component:

```sh
npx shadcn@latest init --base base --preset nova --yes --no-monorepo
npx shadcn@latest add ourostack/ouro-ui/ouro-base#v1.3.823
npx shadcn@latest add ourostack/ouro-ui/ring-card#v1.3.823
```

More: [Installing](https://ui.ouroboros.bot/docs/installing.md).

```tsx
import { RingCard } from "@/components/ouro/ring-card/ring-card";
```

## Example

```tsx
<RingCard arriving caller="Mara Vale" kind="video" announcement="Mara Vale is calling."
  onDecline={decline} onAudio={answerAudio} onVideo={answerVideo} />
```

## Use instead when

- Use `Alert` instead when showing an app notice, and `ConfirmDialog` when a decision must interrupt.

## Props

Type: `RingCardProps`.

| Prop | Type | Description |
| --- | --- | --- |
| `announcement` (required) | `string` | The ring's assertive announcement, including any page-owned shortcuts. Clear after the person acts. |
| `arriving` | `boolean` | Animate a newly received call. Omit for a call already present when the page loads. |
| `avatar` | `{ src?: string \| undefined }` | The caller's photo; their initials stand in while it loads. |
| `caller` (required) | `string` | Who is calling. |
| `chips` | `ReactNode` | Quiet alternatives, such as a Button to message instead. Hidden during pending and failure. |
| `className` | `string` | Layout only: width, margins and placement. Appearance belongs to RingCard. |
| `failure` | `{ title: string; line?: string \| null \| undefined; action: ReactNode; announcement: string } \| null` | Failure content, a host-provided recovery control and a polite announcement. |
| `keys` | `{ decline: string; audio: string; video: string }` | Optional page-owned shortcuts, shown in tooltips. RingCard registers no keyboard handlers. |
| `kind` (required) | `"audio" \| "video"` | How the incoming call arrives. |
| `labels` | `{ region: (caller: string) => string; audioCall: string; videoCall: string; decline: string; audio: string; video: string; answerAudio: string; answerVideo: string }` | Translate the card's words with the rest of the app. |
| `note` | `string \| null` | The caller's optional note. |
| `onAudio` (required) | `MouseEventHandler<HTMLButtonElement>` | The person's audio answer; never offer it through an agent door. |
| `onDecline` (required) | `MouseEventHandler<HTMLButtonElement>` | The person's decline action; never offer it through an agent door. |
| `onVideo` (required) | `MouseEventHandler<HTMLButtonElement>` | The person's video answer; never offer it through an agent door. |
| `pending` | `{ label: string; media: "audio" \| "video" \| null \| (string & { 'Use "audio", "video" or null': never }) } \| null` | A calm line instead of the choices while the call connects or declines. |
| `ref` | `Ref<HTMLDivElement>` | Reaches the rendered element. |

## Native attributes

Also accepts the attributes in React's `HTMLAttributes` (`id`, `aria-*`, event handlers), passed to the rendered element, except those named on this page.

## `className` is for layout only

Pass margins, width and grid placement (`mt-4`, `w-full`, `col-span-2`).

Appearance comes from props, not classes. In development, a class that sets appearance logs one warning per component instance, naming the prop to use instead. A class sets appearance when, after its variants (`hover:`, `sm:`) and any `!` are removed, it starts with `bg-`, `text-`, `border-`, `rounded-`, `shadow-`, `font-`, `ring-`, `from-`, `via-`, `to-`, `fill-` or `stroke-`, or is `border`, `rounded`, `shadow` or `ring`, or has a `dark:` variant. Text wrapping, overflow and table layout classes (`text-wrap`, `text-ellipsis`, `border-collapse`) are layout and do not warn.

Alignment classes (`text-center`) warn too: set alignment on a parent element.
