# 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-core-ui/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)
        )
    )
```

```Razor TagHelper
    <kendo-promptbox name="promptBox">
        <action-button icon="sparkles" fill-mode="FillMode.Flat">
        </action-button>
    </kendo-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 `SpeechToText` option. The button provides visual feedback during the speech recognition process.

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

```Razor TagHelper
    <kendo-promptbox name="promptBox">
        <speech-to-text enabled="true">
        </speech-to-text>
    </kendo-promptbox>
```

## 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" }))
        )
    )
```

```Razor TagHelper
    <kendo-promptbox name="promptBox">
        <file-attachment multiple="true">
            <restrictions allowed-extensions='new string[] { ".jpg", ".png" }'>
            </restrictions>
        </file-attachment>
    </kendo-promptbox>
```

### 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)
        )
    )
```

```Razor TagHelper
    <kendo-promptbox name="promptBox">
        <file-attachment multiple="true">
        </file-attachment>
    </kendo-promptbox>
```

### 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))
        )
    )
```

```Razor TagHelper
    <kendo-promptbox name="promptBox">
        <file-attachment>
            <restrictions max-file-size="1048576">
            </restrictions>
        </file-attachment>
    </kendo-promptbox>
```

### 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" }))
        )
    )
```

```Razor TagHelper
    <kendo-promptbox name="promptBox">
        <file-attachment>
            <restrictions allowed-extensions='new string[] { ".png", ".jpg", ".jpeg" }'>
            </restrictions>
        </file-attachment>
    </kendo-promptbox>
```

## See Also

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

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

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

* [Server-Side API of the PromptBox TagHelper](https://www.telerik.com/aspnet-core-ui/documentation/api/taghelpers/promptbox)

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