# ConversationListView

> Props, styling and a live ConversationListView example.

`ConversationListView` from `@polymorfa/react`. Choose props and styles above; the preview stays visible in every code view.

## Props

| Prop | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `conversations` | `readonly InboxConversation[]` | Required |  | Rows to show. |
| `selectedId` | `string` | Optional |  | The open conversation. |
| `onSelect` | `(conversation: InboxConversation) => void` | Required |  | Called when a row is selected. |
| `title` | `ReactNode` | Optional |  | Same as `ConversationList`. |
| `search` | `boolean` | Optional |  | Same as `ConversationList`. |
| `query` | `string` | Optional |  | Controlled search, when supplied. |
| `onQueryChange` | `(query: string) => void` | Optional |  | Same as `ConversationList`. |
| `drafts` | `Readonly<Record<string, string>>` | Optional |  | Same as `ConversationList`. |
| `onAction` | `(conversation: InboxConversation, action: InboxRowAction) => Promise<void>` | Optional |  | Confirm the mutation through the owning source, then refresh its rows. |
| `actions` | `(conversation: InboxConversation) => readonly InboxRowAction[]` | Optional |  | Only offer actions supported and authorized by the host. |
| `onNewConversation` | `() => void` | Optional |  | Same as `ConversationList`. |
| `status` | `InboxSnapshot["status"]` | Optional |  | Shows loading and error states. |
| `onRetry` | `() => void` | Optional |  | Retry action for the error state. |
| `hasMore` | `boolean` | Optional | `false` | Shows Load more conversations. |
| `onLoadMore` | `() => void` | Optional |  | Shows Load more conversations. |
| `className` | `string` | Optional |  | Same as `ConversationList`. |
| `classNames` | `SlotClassNames` | Optional |  | Same as `ConversationList`. |

## Types

Named types used in the props above.

```ts @polymorfa/ui
type InboxRowAction =
  | "pin"
  | "unpin"
  | "archive"
  | "unarchive"
  | "mark-read"
  | "mark-unread";
```

## Styling

Use `className`, `classNames` (a class for any [slot](https://docs.polymorfa.com/ui-kit/appearance#slots), typed `SlotClassNames`), appearance variables and element styles. The Style panel applies changes to the live component. See [Appearance](https://docs.polymorfa.com/ui-kit/appearance).

## Setup

Use [the provider and server route](https://docs.polymorfa.com/ui-kit/setup) for your application. The preview above uses local sample data and controllers. [Chat controllers](https://docs.polymorfa.com/ui-kit/chat#controllers) and [inbox data sources](https://docs.polymorfa.com/ui-kit/inbox#data-sources) keep your data separate from the UI.
