The Blazor InlineAIPrompt component adds an AI assistant to any text field: a button opens an AIPrompt in a popup, the field value or its selection is the context and the result replaces or extends the value.
Console log
Bind Value to the same value as the field, for example with @bind-Value, and the component replaces or appends to it when the user applies the output.
Set TargetId to the id of the input or textarea: the text selected in it when the popup opens becomes the context and only the selection is replaced. Without a selection the whole value is the context.
Suggestions and Commands work as in AIPrompt; the default SystemPrompt asks the model for the resulting text only, without explanations or markdown.
The button is configurable through Icon, Text, ButtonStyle, Variant and Size; set ShowButton="false" and call OpenAsync(element) to open the popup from your own trigger, for example a keyboard shortcut or a selection toolbar.
Applied fires with the new value, Generated with every output, and Open and Close follow the popup. The popup width is set by the --rz-inline-aiprompt-popup-width CSS variable.
Bind Value to the same value as the field. Replace sets the value to the output, or only the selected part of it when TargetId points to the input and text is selected; Append adds the output after the value.
Yes. Set ShowButton to false and call OpenAsync with the element to anchor the popup to, for example from a keyboard shortcut or a selection toolbar.
Radzen Blazor Components, © 2018-2026 Radzen.
Source Code licensed under
MIT
On this page