# AIPrompt ToolBar

The AIPrompt ToolBar renders buttons for the predefined views (Prompt, Output, and Command) and also allows you to add custom tools, which may invoke arbitrary commands or handlers.
The toolbar buttons for the Prompt and Output views are always available, while the one for the Commands view is optional. Any custom buttons that you add will always appear after the view-related buttons.

* [Built-in Tools](https://www.telerik.com/blazor-ui/documentation/components/aiprompt/toolbar#built-in-tools)
* [Custom Tools](https://www.telerik.com/blazor-ui/documentation/components/aiprompt/toolbar#custom-tools)

## Built-in Tools

### AIPromptToolBarButton

The AI Prompt ToolBar button is a plain button that you can click and it raises an event so the application can respond to that.

You can add multiple buttons to the Telerik AIPrompt. To do that you should add the `<AIPromptToolBarButton>` to the `<AIPromptToolBar>`.

### AIPromptToolBarButton parameters

The `AIPromptToolBarButton` tag exposes parameters that allow you to customize the buttons:

<style>
    .article table {
        table-layout: auto;
        word-break: normal;
    }
</style>

| Parameter      | Type and Default Value          | Description                                                                                                                                                                                                                                |
| -------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Class`        | `string`                        | The CSS class that will be rendered on the main wrapping element of the AIPromptToolBarButton. You could use that class to cascade styles.                                                                                                 |
| `Icon`         | `object`                        | Adds a font icon to the button. You can find more information on adding a font icon to a Telerik Component in [Telerik Font and Svg Icons article](https://www.telerik.com/blazor-ui/documentation/common-features/icons#icon-namespaces). |
| `OnClick`      | `EventCallback<MouseEventArgs>` | The event handler for the button click.                                                                                                                                                                                                    |
| `ChildContent` | `RenderFragment`                | The child content rendered within the button.                                                                                                                                                                                              |

### AIPromptToolBarSpacer

The spacer consumes the available empty space and pushes the rest of the tools next to one another.

## Custom Tools

To define custom tools within the ToolBar, use the `<AIPromptToolBarTemplateItem>` tag, which is a standard Blazor `RenderFragment`.

The example below omits any event handlers for brevity. Custom buttons are to be used for arbitrary logic which is not part of the AIPrompt component, thus feel free to attach the handlers you need.

> caption Setting up the AIPrompt ToolBar

<demo metaUrl="client/aiprompt/toolbar/configuration-1/" height="420"></demo>

## Next Steps

* [Customize the AIPrompt Views](https://www.telerik.com/blazor-ui/documentation/components/aiprompt/views/overview)
* [Implement AIPrompt Templates](https://www.telerik.com/blazor-ui/documentation/components/aiprompt/templates)
* [Handle AIPrompt Events](https://www.telerik.com/blazor-ui/documentation/components/aiprompt/events)

## See Also

* [Views Templates](https://www.telerik.com/blazor-ui/documentation/components/aiprompt/views/templates)
* [Live Demo: AIPrompt Overview](https://demos.telerik.com/blazor-ui/aiprompt/overview)
