New to Telerik UI for BlazorStart a free 30-day trial

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:

C#
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.InvokeVoidAsyncWithoutAwait(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

C#
public TelerikPromptBox()

Methods

C#
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters:__builderRenderTreeBuilder

Overrides: ComponentBase.BuildRenderTree(RenderTreeBuilder)

C#
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters:firstRenderboolReturns:

Task

Overrides: TextBoxBase.OnAfterRenderAsync(bool)

C#
protected override void OnParametersSet()

Overrides: ComponentBase.OnParametersSet()

C#
public void RemoveActionButtonSettings()

Properties

[Accessibility] Defines the autocomplete HTML attribute of the component.

C#
[Parameter]
public string AutoComplete { get; set; }

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

C#
[Parameter]
public bool EnableActionButton { get; set; }

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.

C#
[Parameter]
public bool EnableFileSelect { get; set; }

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.

C#
[Parameter]
public bool EnableSpeechToText { get; set; }

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

C#
[Parameter]
public override string FillMode { get; set; }

Overrides: TextBoxBase.FillMode

InputFiles

IList<FileSelectFileInfo>

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

C#
[Parameter]
public IList<FileSelectFileInfo> InputFiles { get; set; }

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

C#
[Parameter]
public EventCallback<IList<FileSelectFileInfo>> InputFilesChanged { get; set; }

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 .

C#
[Parameter]
public bool IsLoading { get; set; }

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

C#
[Parameter]
public int? MaxLength { get; set; }

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

C#
[Parameter]
public string MaxTextAreaHeight { get; set; }

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

C#
[Parameter]
public PromptBoxMode Mode { get; set; }

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.

C#
[Parameter]
public EventCallback<PromptBoxActionButtonEventArgs> OnPromptAction { get; set; }

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

C#
[Parameter]
public RenderFragment PromptBoxEndAffixTemplate { get; set; }

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

C#
[Parameter]
public RenderFragment PromptBoxSettings { get; set; }

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

C#
[Parameter]
public RenderFragment PromptBoxStartAffixTemplate { get; set; }

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

C#
[Parameter]
public RenderFragment PromptBoxTopAffixTemplate { get; set; }

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

C#
[Parameter]
public override string Rounded { get; set; }

Overrides: TextBoxBase.Rounded

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

C#
[Parameter]
public int Rows { get; set; }
Remarks:

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

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

C#
[Parameter]
public override string Size { get; set; }

Overrides: TextBoxBase.Size