ChannelPreviewUnreadCount
Renders unread count inside ChannelList. This is the default component for the PreviewUnreadCount prop.
Best Practices
- Clamp counts with
maxUnreadCountto avoid overflow. - Hide the badge when
unreadis zero. - Keep badge size consistent across the list.
- Use channel-level unread counts for accuracy.
- Avoid expensive formatting in render.
Props
channel
Channel instance from the Stream Chat client.
| Type |
|---|
| Channel |
maxUnreadCount
Max number shown in the unread badge. The value cannot exceed the backend limit of 255.
| Type | Default |
|---|---|
| number | 255 |
unread
Number of unread messages in the channel.
| Type |
|---|
| number |