New to Telerik UI for Blazor? Start a free 30-day trial

Events

Updated on Oct 1, 2026

The Blazor PromptBox component provides comprehensive event handling for user interactions and state changes. This article explains the events available in the PromptBox component and how to use them effectively.

The PromptBox fires events for text input changes, action button interactions, speech-to-text results, and file selection activities.

OnPromptAction

The OnPromptAction event represents the primary user action for submitting content or stopping ongoing operations. This event fires when:

  • The user clicks the action button
  • The user presses Enter (when content is available and not loading)
  • The button state changes between Send and Stop modes

The event provides PromptBoxActionButtonEventArgs containing the current text and action type.

Handle action button interactions

Example
View Source
Loading ...

The event is an EventCallback. It can be synchronous and return void, or asynchronous and return async Task. Do not use async void.

ValueChanged

The ValueChanged event fires upon every change in the text input (such as each keystroke). When using the ValueChanged event, you cannot use two-way data binding because the @bind-Value directive internally uses this event.

Handle ValueChanged event

Example
View Source
Loading ...

OnChange

The OnChange event represents a user confirmation of the current value. It is triggered when the input loses focus after the value has been changed during that focus session.

Handle OnChange event

Example
View Source
Loading ...

OnBlur

The OnBlur event fires when the PromptBox loses focus, regardless of whether the value has changed.

Handle OnBlur event

Example
View Source
Loading ...

Speech-to-Text Events

When speech-to-text functionality is enabled, the PromptBox provides events through the PromptBoxSpeechToTextButtonSettings:

  • OnStart: Fires when speech recognition begins.

  • OnResult: Fires when speech recognition returns results. Provides SpeechToTextButtonResultEventArgs with recognition data.

  • OnEnd: Fires when speech recognition ends or disconnects.

  • OnError: Fires when a speech recognition error occurs.

Speech-to-text event handling

Example
View Source
Loading ...

File Selection Events

File selection events are handled through the PromptBoxFileSelectButtonSettings.

OnSelect

Fires when users select files. Provides FileSelectEventArgs with information about the selected files.

See Also