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

# AgentHandoff

What a person does once they have seen something built for agents: hand it to their coding agent, as one line to paste, with Copy beside it. The line is in the page's own type, never a terminal's, and a web address in it can break after each "/". Copy is CopyButton, which says it copied on itself, where the person is looking. In a narrow column Copy goes under the line, so the line has the column's whole width. It takes its container's width.

## 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.344
npx shadcn@latest add ourostack/ouro-ui/agent-handoff#v1.3.344
```

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

```tsx
import { AgentHandoff } from "@/components/ouro/agent-handoff/agent-handoff";
```

## Example

```tsx
<AgentHandoff
  label="Hand it to your agent"
  prompt="Build this app's interface with Ouro UI. Read https://ui.ouroboros.bot/llms.txt first and follow it."
  caption="Paste it into your coding agent's chat."
/>
```

## Use instead when

- Use `CopyButton` instead for a value that isn't an instruction to an agent, and `CodeBlock` instead for a command to run in a terminal.

## Props

Type: `AgentHandoffProps`.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `aside` | `ReactNode` |  | At the end of the label's row, such as a Badge with the release the line brings in. |
| `caption` | `ReactNode` |  | Under the line, such as "Paste it into your coding agent's chat." |
| `className` | `string` |  | Layout only: margins, width (`mt-8`, `max-w-xl`). Appearance classes warn in development. |
| `copiedLabel` | `string` | `"Copied"` | What the Copy button says once the line is on the clipboard. |
| `copyLabel` | `string` | `"Copy"` | The Copy button's label. |
| `failedMessage` | `string` | `"The browser blocked copying. Select the line and copy it yourself."` | What screen readers hear, and the Copy button's tooltip says, when the browser refused to copy. |
| `label` (required) | `ReactNode` |  | What the person does with the line, above it, which also names the group: "Hand it to your agent". |
| `prompt` (required) | `string` |  | The one line to paste into a coding agent's chat, in the page's own type. A web address in it can break after each "/", between its parts, but not inside "//". |
| `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.

## Don't use

These are not props. Passing one fails the type check with the fix in the error, and in development a console message names the fix.

- `command`: Not a prop. AgentHandoff hands an agent a line to paste, `prompt`; for a command to run in a terminal, use CodeBlock.
- `description`: Not a prop. The words under the line are `caption`: `<AgentHandoff caption="Paste it into your coding agent's chat." />`.
- `hint`: Not a prop. The words under the line are `caption`: `<AgentHandoff caption="Paste it into your coding agent's chat." />`.
- `text`: Not a prop. The line to paste is `prompt`: `<AgentHandoff prompt="Read https://example.com/llms.txt" />`.
- `title`: Not a prop. The words above the line are `label`: `<AgentHandoff label="Hand it to your agent" />`.
- `value`: Not a prop. The line to paste is `prompt`: `<AgentHandoff prompt="Read https://example.com/llms.txt" />`.

## `className` is for layout only

Pass margins, width and grid placement (`mt-4`, `w-full`, `col-span-2`). Your classes always win over Ouro UI's: AgentHandoff merges `className` last with `cn` (tailwind-merge), so a class that conflicts with its own replaces it.[^layout-classes]

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.

[^layout-classes]: test:registry/ouro/components/ouro/agent-handoff/agent-handoff.test.tsx::AgentHandoff > forwards a ref, passes attributes through, and lets the app's layout classes win verify:testExists(registry/ouro/components/ouro/agent-handoff/agent-handoff.test.tsx::AgentHandoff > forwards a ref, passes attributes through, and lets the app's layout classes win)
