You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CSS file includes one of our default themes. You can replace it with a different theme or create a custom one if you want the <ApiLinktype="Chat" /> to match your application’s branding.
72
102
73
103
## Usage
@@ -110,6 +140,24 @@ return (
110
140
111
141
</PlatformBlock>
112
142
143
+
<PlatformBlockfor="Blazor">
144
+
145
+
146
+
```cs
147
+
publicIgbChatOptionsOptions=newIgbChatOptions()
148
+
{
149
+
CurrentUserId="user",
150
+
HeaderText="Support Chat"
151
+
};
152
+
```
153
+
154
+
```razor
155
+
<IgbChat @ref="Chat" Options="Options">
156
+
</IgbChat>
157
+
```
158
+
159
+
</PlatformBlock>
160
+
113
161
114
162
Here, the `currentUserId` property tells the component which messages are “outgoing” (sent by the current user) versus “incoming” (sent by others). The `headerText` provides a title for the chat window.
This approach makes it easy to plug the Chat into your own data source, such as a server endpoint, a chatbot engine, or a collaborative app backend.
169
247
170
248
### Properties
@@ -179,6 +257,8 @@ The <ApiLink type="Chat" /> component exposes several key properties that let yo
179
257
180
258
These properties make it straightforward to synchronize the Chat’s UI with your application’s state and backend.
181
259
260
+
<PlatformBlockfor="WebComponents, React">
261
+
182
262
### Attachments
183
263
Modern conversations are rarely limited to text alone. The Chat component includes built-in support for file attachments, allowing users to share images, documents, and other files.
184
264
By default, the input area includes an attachment button. You can control which file types are allowed by setting the `acceptedFiles` property:
Quick reply suggestions provide users with pre-defined responses they can tap to reply instantly. This feature is particularly useful in chatbots, customer service flows, or when guiding users through a structured process.
238
320
You can provide suggestions by binding an array of strings to the suggestions property. The `suggestions-position` attribute lets you control where they are displayed: either below the input area or below the messages list.
This approach helps streamline user interactions by reducing the need to type repetitive answers and improves the overall experience in guided conversations.
The <ApiLinktype="Chat" /> component provides two renderers which are useful when you want to keep the default actions (upload and send) but extend them with additional controls:
421
584
-`inputActionsStart` – allows you to inject custom content after the built-in upload button.
422
585
-`inputActionsEnd` – allows you to inject custom content after the built-in send button.
423
586
424
-
For example, you might want to add a voice recording button after the upload button, or a menu of extra options after the send button.
587
+
For example, you might want to add a voice recording button before the other buttons, or a menu of extra options after the send button.
425
588
In the following example, the default upload button is preserved, but we add a microphone button next to it. On the other end, we remove the default send button and replace it with a custom Ask button and a “more” menu:
- A microphone button is added after it (inputActionsStart).
483
686
- The default send button is removed and replaced with a custom Ask button and a “more” icon (inputActionsEnd).
484
687
485
688
This approach gives you full flexibility over the chat input bar, letting you add, remove, or reorder actions without rebuilding the input area from scratch.
486
689
690
+
<PlatformBlockfor="WebComponents, React">
691
+
487
692
### Markdown Rendering
488
693
489
694
<PlatformBlockfor="WebComponents">
@@ -572,6 +777,8 @@ This will enable highlighted code blocks for JavaScript, Python, and Go, styled
572
777
|`theme`| An object specifying **Shiki** themes to apply. Supports separate values for `light` and `dark` mode (e.g., `{ light: 'github-light', dark: 'github-dark' }`). |
573
778
|`sanitizer`| A custom function to sanitize the final HTML. Defaults to `DOMPurify.sanitize`. |
574
779
780
+
</PlatformBlock>
781
+
575
782
### Events
576
783
To integrate with your application logic, the Chat component emits a set of events:
577
784
@@ -608,6 +815,17 @@ To integrate with your application logic, the Chat component emits a set of even
608
815
609
816
</PlatformBlock>
610
817
818
+
819
+
<PlatformBlockfor="Blazor">
820
+
821
+
- MessageCreated – when a new message is created.
822
+
- MessageReact – when a message is reacted to.
823
+
- TypingChange – when typing status changes.
824
+
- InputFocus / onInputBlur – input focus events.
825
+
- InputChange – when the input value changes.
826
+
827
+
</PlatformBlock>
828
+
611
829
You can listen for these events and sync them with your backend:
0 commit comments