Blazor PromptBox Overview

Updated on Feb 10, 2026

The Blazor PromptBox component facilitates human-AI communication with a feature-rich input interface. It combines text input, speech-to-text functionality, file attachments, and intelligent layout adaptation to provide a comprehensive user experience for AI workflows.

ninja-iconThe PromptBox component is part of Telerik UI for Blazor, a professional grade UI library with 110+ native components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.Start Free Trial

The component also offers advanced functionality like automatic mode switching, integrated action buttons, and customizable adornments.

Basic Usage

  1. Add the <TelerikPromptBox> tag to a Razor file.
  2. Set the Value parameter to a string object. It supports one-way and two-way binding.
  3. (optional) Set the Mode parameter to control input behavior: SingleLine, MultiLine, or Auto (default).
  4. (optional) Configure built-in features like EnableSpeechToText and EnableFileSelect.
  5. (optional) Handle the OnPromptAction event to respond to user submissions.

Basic PromptBox with auto-expanding mode

<TelerikPromptBox @bind-Value="@Prompt"
                  Mode="PromptBoxMode.Auto"
                  Placeholder="Type, speak, or attach files…"
                  OnPromptAction="@OnActionButtonClick" />
<p>Current prompt: @Prompt</p>

@code {
    private string Prompt = string.Empty;

    private async Task OnActionButtonClick(PromptBoxActionButtonEventArgs args)
    {
        if (args.Action == PromptBoxActionType.Send)
        {
            // Process the user input
            Console.WriteLine($"User submitted: {args.Text}");

            // Clear the prompt after processing
            Prompt = string.Empty;
        }
    }
}

Input Modes

The component supports three input modes that adapt to different use cases. Read more about PromptBox modes....

File Attachments

Users can attach files directly through the integrated file selection button. Read more about PromptBox file attachments....

Adornments

The PromptBox supports customizable adornments that adapt to the current input mode. You can add custom buttons, icons, or components as prefixes, suffixes, or top-level elements. Read more about PromptBox adornments....

Events

The PromptBox fires events to respond to user interactions and state changes. Read more about PromptBox events....

PromptBox API

To review all available parameters for the PromptBox component, see the PromptBox API Reference.

Next Steps