useChannelDetailsMembersPreview
A hook that builds a capped preview of a channel's members for the members section of ChannelDetails. It returns the first max members to display, the total member count, and whether more members exist beyond the preview.
Best Practices
- Use it to render a member preview row with a "view all" entry point instead of slicing the member list yourself.
- Pass an already-initialized channel so member state is available.
- Use
hasMoreto decide whether to show a "view all members" affordance. - Keep
maxstable across renders to avoid unnecessary recomputation. - Prefer
totalovervisible.lengthwhen displaying the member count.
Parameters
| Parameter | Description | Type |
|---|---|---|
channel | The channel whose members should be previewed. | Channel |
max | Maximum number of members to include in visible. Defaults to 5. | number |
Return type
Returns a ChannelDetailsMembersPreview object.
hasMore
Whether there are more members than the max shown in visible.
| Type |
|---|
boolean |
total
The total number of members in the channel.
| Type |
|---|
number |
visible
The capped list of members to display (up to max).
| Type |
|---|
ChannelMemberResponse[] |