Class SuggestionTemplateContext
Represents the context provided to a custom SuggestionTemplate in SfChatUI,
supplying the suggestion text and its zero-based position in the list.
Inherited Members
Namespace: Syncfusion.Blazor.InteractiveChat
Assembly: Syncfusion.Blazor.dll
Syntax
public class SuggestionTemplateContext
Remarks
This context object is passed to the SuggestionTemplate parameter of SfChatUI.
Use Index to determine the order of the suggestion, and
Suggestions to access the suggestion text for rendering.
Examples
<SfChatUI>
<SuggestionTemplate>
<div class="suggestion-item">
<span class="suggestion-index">@context.Index</span>
<span class="suggestion-text">@context.Suggestions</span>
</div>
</SuggestionTemplate>
</SfChatUI>
Constructors
SuggestionTemplateContext()
Declaration
public SuggestionTemplateContext()
Properties
Index
Gets or sets the index of the suggestion item in the SfChatUI component.
Declaration
public int Index { get; set; }
Property Value
| Type | Description |
|---|---|
| int | An int representing the order of the suggestion item within a list of suggestions. The default value is |
Remarks
This property specifies the index position of the suggestion item, which is used to identify its order within the list of suggestions.
Suggestions
Gets or sets the suggestion text in the SfChatUI component.
Declaration
public string Suggestions { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string representing the suggested text that is being rendered within the template. The default value is |
Remarks
This property specifies the text of the suggestion item, which is displayed within the suggestion template.