# CallSurface

> Props, styling and a live CallSurface example.

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

## Props

| Prop | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `resolveName` | `(peer: string) => string \| undefined` | Optional |  | Resolve a display name for a number (contact lookup). |
| `resolveAvatar` | `AvatarResolver` | Optional | Colored initials | Resolve an avatar URL for a number (sync or async). |
| `disableVideo` | `boolean` | Optional | `false` | Hide the camera control even when the call can carry video. |
| `popout` | `boolean` | Optional | `true` | Offer the ↗ pop-out window button. Defaults to true. |
| `renderMedia` | `CallStageProps["renderMedia"]` | Optional |  | Replace the stage's media region without forking state. |
| `exclusive` | `boolean` | Optional | `false` | Claim calls answered from this surface. Default `false`: other participants keep ringing and can join. |
| `showParticipants` | `boolean` | Optional | `true` | Show the participant list during a call. Defaults to true. |
| `showLeave` | `boolean` | Optional | On calls nobody claimed | Show the Leave button; see `CallControlsProps.showLeave`. |
| `labelVideo` | `ParticipantVideoGridProps["labelVideo"]` | Optional | The participant's number or ID | Label for a remote video tile. |
| `controller` | `CallsController` | Optional |  | Calls state. |
| `createController` | `() => CallsController` | Optional |  | Factory for a controller the component owns. |

## Types

Named types used in the props above.

```ts @polymorfa/react
type AvatarResolver = (peer: string) => string | undefined | Promise<string | undefined>;
```

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