Class
TelerikPromptBox

Represents a chat-style input box component for user prompts and messages.

The PromptBox allows users to type text, supports event callbacks for value changes, and provides customizable templates for affixes at the start, end, or top of the input area.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

cs-api-definition
public class TelerikPromptBox : TextBoxBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentTelerikInputBase<string>TextBoxBaseTelerikPromptBox

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members TextBoxBase.OnParametersSetAsync()TextBoxBase.Dispose()TextBoxBase.InitJsComponentAsync()TextBoxBase.OnParametersSetInternalAsync()TextBoxBase.OnAfterRenderInternalAsync(bool)TextBoxBase.UpdateValueDebounced(string)TextBoxBase.TitleTextBoxBase.PlaceholderTextBoxBase.DataSmartPasteDescriptionAttributeTextBoxBase.WidthTextBoxBase.NameTextBoxBase.DebounceDelayTextBoxBase.ReadOnlyTextBoxBase.AutoCapitalizeTextBoxBase.SpellCheckTelerikInputBase<string>.SetParametersAsync(ParameterView)TelerikInputBase<string>.OnInitializedAsync()TelerikInputBase<string>.FocusAsync()TelerikInputBase<string>.CascadedEditContextTelerikInputBase<string>.FloatingLabelTelerikInputBase<string>.IdTelerikInputBase<string>.EnabledTelerikInputBase<string>.TabIndexTelerikInputBase<string>.ValueExpressionTelerikInputBase<string>.ValueChangedTelerikInputBase<string>.ValueTelerikInputBase<string>.OnChangeTelerikInputBase<string>.OnBlurTelerikInputBase<string>.AriaLabelTelerikInputBase<string>.AriaLabelledByTelerikInputBase<string>.AriaDescribedByTelerikInputBase<string>.ValidateOnTelerikInputBase<string>.InputModeBaseComponent.ShouldRender()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnInitialized()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)

Constructors

TelerikPromptBox()

Declaration

cs-api-definition
public TelerikPromptBox()

Properties

AutoComplete

Defines the autocomplete HTML attribute of the component.

Declaration

cs-api-definition
[Parameter]
public string AutoComplete { get; set; }

Property Value

string

EnableActionButton

Enables or disables the action button in the prompt box component.

Declaration

cs-api-definition
[Parameter]
public bool EnableActionButton { get; set; }

Property Value

bool

EnableFileSelect

Enables or disables the file select functionality in the prompt box component. Renders a file upload icon in the prompt box that allows users to select files.

Declaration

cs-api-definition
[Parameter]
public bool EnableFileSelect { get; set; }

Property Value

bool

EnableSpeechToText

Enables or disables the speech-to-text functionality in the prompt box component. Renders a microphone icon in the promptbox input area that allows users to convert speech to text.

Declaration

cs-api-definition
[Parameter]
public bool EnableSpeechToText { get; set; }

Property Value

bool

FillMode

Specifies the fill mode of the PromptBox. Default value is Solid.

Declaration

cs-api-definition
[Parameter]
public override string FillMode { get; set; }

Property Value

string

Overrides TextBoxBase.FillMode

InputFiles

Gets or sets the collection of files selected as input for processing.

Declaration

cs-api-definition
[Parameter]
public IList<FileSelectFileInfo> InputFiles { get; set; }

Property Value

IList<FileSelectFileInfo>

InputFilesChanged

Event callback that is triggered when files are selected through the file select button. Provides the list of selected files as arguments.

Declaration

cs-api-definition
[Parameter]
public EventCallback<IList<FileSelectFileInfo>> InputFilesChanged { get; set; }

Property Value

EventCallback<IList<FileSelectFileInfo>>

IsLoading

Gets or sets a value indicating whether the prompt box is in a loading state. When true, the action button shows the stop / (loading icon) set in .

Declaration

cs-api-definition
[Parameter]
public bool IsLoading { get; set; }

Property Value

bool

MaxLength

Gets or sets the maximum number of characters allowed in the input.

Declaration

cs-api-definition
[Parameter]
public int? MaxLength { get; set; }

Property Value

int?

MaxTextAreaHeight

Gets or sets the maximum height for multi-line or auto mode (e.g. "200px"), preventing uncontrolled vertical growth.

Declaration

cs-api-definition
[Parameter]
public string MaxTextAreaHeight { get; set; }

Property Value

string

Mode

Defines the mode of the PromptBox - single-line, multi-line, or auto.

Declaration

cs-api-definition
[Parameter]
public PromptBoxMode Mode { get; set; }

Property Value

PromptBoxMode

OnPromptAction

Event callback that is triggered when a text is submitted or stop operation is triggered when IsLoading is true. The arguments are of type PromptBoxActionButtonEventArgs.

Declaration

cs-api-definition
[Parameter]
public EventCallback<PromptBoxActionButtonEventArgs> OnPromptAction { get; set; }

Property Value

EventCallback<PromptBoxActionButtonEventArgs>

PromptBoxEndAffixTemplate

Use for actions like send buttons or status indicators positioned at the end.

Declaration

cs-api-definition
[Parameter]
public RenderFragment PromptBoxEndAffixTemplate { get; set; }

Property Value

RenderFragment

PromptBoxSettings

Defines a render fragment that contains all settings for the PromptBox. Children: PromptBoxSpeechToTextButtonSettings, PromptBoxFileSelectButtonSettings, PromptBoxActionButtonSettings.

Declaration

cs-api-definition
[Parameter]
public RenderFragment PromptBoxSettings { get; set; }

Property Value

RenderFragment

PromptBoxStartAffixTemplate

Template rendered before the input (prefix/start affix). Use for icons, buttons, or context labels positioned at the start.

Declaration

cs-api-definition
[Parameter]
public RenderFragment PromptBoxStartAffixTemplate { get; set; }

Property Value

RenderFragment

PromptBoxTopAffixTemplate

Template rendered above the input (top affix). Use for headings, helper text, or suggestion chips shown above the prompt box.

Declaration

cs-api-definition
[Parameter]
public RenderFragment PromptBoxTopAffixTemplate { get; set; }

Property Value

RenderFragment

Rounded

Specifies the rounding of the PromptBox. Default value is Medium.

Declaration

cs-api-definition
[Parameter]
public override string Rounded { get; set; }

Property Value

string

Overrides TextBoxBase.Rounded

Rows

Sets the number of visible text lines for the textarea when Mode is Auto or MultiLine.

Declaration

cs-api-definition
[Parameter]
public int Rows { get; set; }

Property Value

int

Remarks

If not explicitly set, defaults to 1 in auto mode and 3 in multiline mode.

Size

Specifies the size of the PromptBox. Default value is Medium.

Declaration

cs-api-definition
[Parameter]
public override string Size { get; set; }

Property Value

string

Overrides TextBoxBase.Size

Methods

BuildRenderTree(RenderTreeBuilder)

Declaration

cs-api-definition
protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

OnAfterRenderAsync(bool)

Declaration

cs-api-definition
protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender

bool

Returns

Task

Overrides TextBoxBase.OnAfterRenderAsync(bool)

OnParametersSet()

Declaration

cs-api-definition
protected override void OnParametersSet()

Overrides ComponentBase.OnParametersSet()

RemoveActionButtonSettings()

Declaration

cs-api-definition
public void RemoveActionButtonSettings()