PromptBox Tools
The PromptBox provides several built-in tools that enhance functionality and user experience.
These tools include the Action button for submitting prompts, the File Select button for attaching files, and the Speech-to-Text button for voice input. If you need additional tools, refer to the PromptBox Adornments article.
Action Button
The Action button submits the prompt. Customize its appearance and behavior by setting the actionButton property to an ActionButtonSettings object.
The button supports a loading state for better user feedback during prompt submission and icon customizations for each state.
The following example demonstrates how to configure the Action Button in the PromptBox.
Speech-to-Text Button
The Speech-to-Text button enables you to input prompts with voice commands. Customize its appearance and behavior by setting the speechToTextButton property to true or SpeechToTextButtonSettings object. The button provides visual feedback during the speech recognition process.
The following example demonstrates how to configure the Speech-to-Text Button in the PromptBox.
File Select Button
The File Select button allows you to attach files to prompts. You can customize its appearance, behavior, and file restrictions by setting the fileSelectButton property to a FileSelectButtonSettings object.
To enable file attachments in the PromptBox, set the fileSelectButton property to true or use FileSelectButtonSettings for further customization.
Attaching Multiple Files
To allow users to attach multiple files, set the multiple property of the FileSelectButtonSettings to true.
<kendo-promptbox
[fileSelectButton]="{ multiple: true }"
></kendo-promptbox>
File Size Restrictions
To restrict the minimum and maximum file size for attachments, set the restrictions property of the FileSelectButtonSettings to an object containing the minFileSize and maxFileSize properties.
<kendo-promptbox
[fileSelectButton]="{ restrictions: { maxFileSize: 1048576, minFileSize: 1024 } }"
></kendo-promptbox>
File Type Restrictions
To restrict the allowed file types for attachments, set the restrictions property of the FileSelectButtonSettings to an object containing the allowedExtensions property.
Additionally, set the accept property to enable the allowed file types in the file selection dialog.
This property accepts an array of strings representing the allowed file types or extensions.
<kendo-promptbox
[fileSelectButton]="{
accept: '.png,.jpg,.jpeg',
restrictions: { allowedExtensions: ['.png', '.jpg', '.jpeg'] }
}"
></kendo-promptbox>