# useChannelPreviewDisplayName

Computes a display name for a channel preview using channel name or member names.

## Best Practices

- Prefer this hook over ad-hoc member-name formatting in list rows.
- Use channel names when available for predictable labeling.
- Handle channels with missing member data gracefully.
- Keep custom naming logic localized to one place for consistency.
- Expect group-channel output in the form `Name1, Name2 and N others`.

## Usage

```tsx
import { useChannelPreviewDisplayName } from "stream-chat-react-native";

const ChannelName = ({ channel }: { channel: Channel }) => {
  const displayName = useChannelPreviewDisplayName(channel);
  return <Text>{displayName ?? "Unknown channel"}</Text>;
};
```

## Parameters

| Name    | Type      | Required | Description                           |
| ------- | --------- | -------- | ------------------------------------- |
| channel | `Channel` | No       | Channel used to resolve display name. |

## Returns

| Type                    | Description                                          |
| ----------------------- | ---------------------------------------------------- |
| `string` \| `undefined` | Computed display name for the channel preview title. |


---

This page was last updated at 2026-04-17T17:33:46.127Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/react-native/hooks/channel-preview/use-channel-preview-display-name/](https://getstream.io/chat/docs/sdk/react-native/hooks/channel-preview/use-channel-preview-display-name/).