# 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. In case you need additional tools, refer to the [PromptBox Adornments](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/conversational-ui/promptbox/adornments) article.

## Action Button

The action button submits the prompt. Customize its appearance and behavior by setting the `ActionButton` option.

The button supports loading state for better user feedback during prompt submission and icon customizations for each state.

```Razor HtmlHelper
    @(Html.Kendo().PromptBox()
        .Name("promptBox")
        .ActionButton(button => button
            .Icon("sparkles")
            .FillMode(FillMode.Flat)
        )
    )
```

## 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 `SpeechToText` option. The button provides visual feedback during the speech recognition process.

```Razor HtmlHelper
    @(Html.Kendo().PromptBox()
        .Name("promptBox")
        .SpeechToText(true)
    )
```

## File Select Button

The file select button allows you to attach files to prompts. Customize its appearance, behavior and file restrictions by setting the `FileAttachment` option.

To enable file attachments in the PromptBox, set the `FileAttachment` option to `true` or use a configuration object for further customization.

```Razor HtmlHelper
    @(Html.Kendo().PromptBox()
        .Name("promptBox")
        .FileAttachment(button => button
            .Multiple(true)
            .Restrictions(r => r.AllowedExtensions(new[] { ".jpg", ".png" }))
        )
    )
```

### Attaching Multiple Files

You can allow users to attach multiple files by setting the `Multiple` option of the `FileAttachment` configuration.

```Razor HtmlHelper
    @(Html.Kendo().PromptBox()
        .Name("promptBox")
        .FileAttachment(button => button
            .Multiple(true)
        )
    )
```

### File Size Restrictions

You can restrict the maximum file size for attachments by setting the `MaxFileSize` option in the `Restrictions` configuration of the `FileAttachment` setting.

```Razor HtmlHelper
    @(Html.Kendo().PromptBox()
        .Name("promptBox")
        .FileAttachment(button => button
            .Restrictions(r => r.MaxFileSize(1048576))
        )
    )
```

### File Type Restrictions

You can restrict the allowed file types for attachments by setting the `AllowedExtensions` option in the `Restrictions` configuration of the `FileAttachment` setting.

```Razor HtmlHelper
    @(Html.Kendo().PromptBox()
        .Name("promptBox")
        .FileAttachment(button => button
             .Restrictions(r => r.AllowedExtensions(new[] { ".png", ".jpg", ".jpeg" }))
        )
    )
```

## See Also

* [PromptBox Adornments](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/conversational-ui/promptbox/adornments)

* [Appearance of the PromptBox](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/conversational-ui/promptbox/appearance)

* [Server-Side API of the PromptBox HtmlHelper](https://www.telerik.com/aspnet-mvc/documentation/api/promptbox)

* [JavaScript API Reference of the PromptBox](https://www.telerik.com/aspnet-mvc/documentation/api/ui/promptbox)
