Skip to content

Commit 54fbf54

Browse files
committed
feat: add content injection points to the channel list
1 parent 93ed9f0 commit 54fbf54

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

docusaurus/docs/Angular/components/ChannelListComponent.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,18 @@ The `ChannelList` component uses the [`Icon`](./IconComponent.mdx) component to
3232

3333
If you only want to customize the channel preview items (not the whole list), see the [channel preview customization](./ChannelPreviewComponent.mdx/#customization) guide.
3434

35+
**Example 3** - Content injection points
36+
37+
It's possible to inject your own content to the top or to the bottom of the channel list:
38+
39+
```html
40+
<stream-channel-list>
41+
<input channel-list-top placeholder="Search" />
42+
<button channel-list-bottom>Add new channel</button>
43+
</stream-channel-list>
44+
```
45+
46+
Use the `channel-list-top` attribute to inject content at the top of the channel list, and the `channel-list-bottom` to display content at the bottom of the channel list.
47+
3548
[//]: # "Start of generated content"
3649
[//]: # "End of generated content"

projects/stream-chat-angular/src/lib/channel-list/channel-list.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
>
3232
{{ "streamChat.You have no channels currently" | translate }}
3333
</p>
34+
<ng-content select="[channel-list-top]"></ng-content>
3435
<ng-container
3536
*ngFor="let channel of channels$ | async; trackBy: trackByChannelId"
3637
>
@@ -69,6 +70,7 @@
6970
></ng-template>
7071
</button>
7172
</div>
73+
<ng-content select="[channel-list-bottom]"></ng-content>
7274
</div>
7375
</div>
7476
</div>

0 commit comments

Comments
 (0)