# AgentDescription

**Slug:** `agent-description`  
**Import:** `import { AgentDescription } from "@p4n/erc8004-ui"`

> **NOTE — unofficial library.** `@p4n/erc8004-ui` is an independent, community-built project. It is not affiliated with, maintained by, or endorsed by the authors of ERC-8004. It reads the standard's on-chain data through public subgraphs; it does not speak for the standard.

## Description

Renders the agent's registered description text from the identity registry.

## Usage

```tsx
import { AgentDescription } from "@p4n/erc8004-ui"
<AgentDescription agentRegistry="eip155:8453:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432" agentId={888} />
```

## Examples

### Inside AgentProvider

Renders the description text without repeating agent identity props.

```tsx
<AgentProvider agentRegistry="eip155:8453:0x8004...a432" agentId={888}>
  <AgentDescription />
</AgentProvider>
```

### Truncated to Two Lines

Use className with line-clamp to constrain long descriptions inside compact cards.

```tsx
<AgentDescription
  agentRegistry="eip155:8453:0x8004...a432"
  agentId={888}
  className="line-clamp-2 max-w-sm text-sm text-erc8004-muted-fg"
/>
```

## In Context

AgentDescription as part of a profile header composition.

```tsx
<AgentProvider agentRegistry="eip155:8453:0x8004...a432" agentId={888}>
  <div className="flex flex-col items-start gap-4 p-4 bg-neutral-900 border border-white/20 rounded-lg sm:flex-row sm:items-center">
    <AgentImage className="min-h-24 min-w-24" />
    <div className="flex min-w-0 flex-col gap-2">
      <div className="flex flex-wrap items-center gap-x-4 gap-y-1">
        <AgentName />
        <VerificationBadge />
      </div>
      <AgentDescription />
    </div>
  </div>
</AgentProvider>
```

## API Reference

| Prop | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `agentRegistry` | `string` | no | — | Agent registry in the format "eip155:{chainId}:{contractAddress}". Required unless inside an <AgentProvider>. |
| `agentId` | `number` | no | — | ERC-721 token ID of the agent. Required unless inside an <AgentProvider>. |
| `className` | `string` | no | — | Optional CSS classes merged onto the component root for layout, spacing, or custom styling (e.g. Tailwind). |

## States

This component handles loading and error states internally with inline placeholders. No configuration needed.

## Reference

- Live preview & full docs: https://erc8004-ui.vercel.app/docs/components/agent-description
- Markdown source: https://erc8004-ui.vercel.app/docs/components/agent-description.md
