# Blazor ButtonGroup Overview

This article provides information about the <a href="https://www.telerik.com/blazor-ui/buttongroup" target="_blank">Blazor ButtonGroup component</a> and its core features.

The ButtonGroup component is a container for [regular and toggle buttons](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/buttons). Before continuing, make sure you are familiar with the differences between [regular buttons](https://www.telerik.com/blazor-ui/documentation/components/button/overview) and [toggle buttons](https://www.telerik.com/blazor-ui/documentation/components/togglebutton/overview).

The ButtonGroup component lets you [select one or more toggle buttons](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/selection), and respond to the [selection and click events](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/events). The buttons inside fill up the container, match the styling according to the [chosen theme](https://www.telerik.com/blazor-ui/documentation/styling-and-themes/overview) and provide the regular button features like images and icons and the other parameters and attributes.

## Comparison with SegmentedControl and TabStrip

The ButtonGroup, SegmentedControl, and TabStrip are similar and even inter-changeable in some aspects. The major differences between these components are:

* The [ButtonGroup](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/overview) supports single and multiple selection. The SegmentedControl and TabStrip can only have one selected (active) item.
* The [SegmentedControl](https://www.telerik.com/blazor-ui/documentation/components/segmentedcontrol/overview) is a databound component. The ButtonGroup and TabStrip use declarative items as child components.
* The [TabStrip](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/overview) renders content containers and manages their visibility out-of-the-box. The ButtonGroup and SegmentedControl can also integrate with separate content containers, but this must rely on the component events and a custom implementation.

## Creating Blazor ButtonGroup

1. Use the `<TelerikButtonGroup>` tag to add the component to your razor page.
2. Inside it, add the desired [button tags](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/buttons) that denote each button - `<ButtonGroupToggleButton>` or `<ButtonGroupButton>`.
3. Optionally, use the `OnClick` event of these buttons to handle the user actions. Read more in the [Events](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/events) article.

> caption Blazor ButtonGroup with regular buttons and toggle buttons, and their respective `OnClick` handlers

<demo metaUrl="client/buttongroup/overview/" height="250"></demo>

## Buttons

The ButtonGroup incorporates two types of buttons - `ButtonGroupToggleButton` and `ButtonGroupButton`. You can individually configure their settings, control their enabled/disabled state and visibility. [Read more about the Blazor ButtonGroup buttons...](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/buttons)

## Icons

To visually communicate the purpose of a button, you can add an image, sprite, or font icon. You can choose between a wide range of built-in font icons or use your custom font icons. [Read more about the Blazor ButtonGroup icons...](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/icons)

## Selection

The ButtonGroup allows you to control the selection mode of its `ButtonGroupToggleButton` instances. The user can select single or multiple `ButtonGroupToggleButton`. [Read more about the selection in the ButtonGroup component...](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/selection)

## Appearance

The separate button instances of the ButtonGroup provide several parameters that control their [styling and appearance, including background color, rounded corners and fill](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/appearance).

> tip To learn more about the appearance, anatomy, and accessibility of the ButtonGroup, visit the [Progress Design System Kit documentation](https://www.telerik.com/design-system/docs/components/buttongroup/)—an information portal offering rich component usage guidelines, descriptions of the available style variables, and globalization support details.

## Events

The Blazor ButtonGroup fires events that you can handle and respond to user actions. [Read more about the Blazor ButtonGroup events....](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/events)

## ButtonGroup Parameters

The following table lists ButtonGroup parameters. Check the [ButtonGroup API Reference](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.telerikbuttongroup) for a full list of properties, methods and events.

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

| Parameter       | Type and Default Value                                                | Description                                                                                                                                                                                                                                                                                                                                   |
| --------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Class`         | `string`                                                              | Additional CSS class to the `<button class="k-button">` element. Use it to apply custom styles or [override the theme](https://www.telerik.com/blazor-ui/documentation/styling-and-themes/override-theme-styles). See [Custom Styling](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/overview#custom-styling) below. |
| `Enabled`       | `bool` <br /> (`true`)                                                | Whether the ButtonGroup is enabled and accepts clicks.                                                                                                                                                                                                                                                                                        |
| `SelectionMode` | `ButtonGroupSelectionMode` <br /> (`ButtonGroupSelectionMode.Single`) | The [selection mode](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/selection) of the ButtonGroup.                                                                                                                                                                                                                    |
| `Width`         | `string`                                                              | The width of the ButtonGroup.                                                                                                                                                                                                                                                                                                                 |

## Custom Styling

You can style the individual buttons through their `Class` attribute to define your own CSS rules that apply to the HTML rendering. You may want to make them conditional based on their `Selected` state.

> caption Set CSS class to the button and change its appearance

<demo metaUrl="client/buttongroup/custom-styling/" height="250"></demo>

## Next Steps

* [Enhance the ButtonGroup with Icons](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/icons)
* [Handle ButtonGroup Events](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/buttons)

## See Also

* [Live Demo: ButtonGroup](https://demos.telerik.com/blazor-ui/buttongroup/overview)
* [Events](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/events)
* [Selection](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/selection)
* [Icons](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/icons)
* [ButtonGroup API Reference](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.telerikbuttongroup)
