# .NET MAUI Label ToolbarItem

Add labels in the toolbar using the `LabelToolbarItem`.

The available properties for configuration are:

* `Text`(`string`)—Defines the text(target type `Label`) in the toolbar item. You can display an image next to the text.
* `ImageSource`(`Microsoft.Maui.Controls.ImageSource`)—Specifies the source of the image to display in the toolbar item.

## Styling

You can style the `LabelToolbarItem` using the `Style` property. The target type of the property is `LabelToolbarItemView`.

The available properties are:

* `Text`(`string`)—Specifies the text in the toolbar item.
* `TextColor`(`Microsoft.Maui.Graphics.Color`)—Specifies the color of the text in the toolbar item.
* `FontFamily`(`string`)—Specifies the font family of the text to display in the toolbar item.
* `FontSize`(`double`)—Specifies the font size of the text to display in the toolbar item. Default value is `16`.
* `FontAttributes`(enum of type `Microsoft.Maui.Controls.FontAttributes`)—Defines the font attributes of the text to display in the toolbar item. Default value is `None`.
* `TextDecorations`(enum of type `Microsoft.Maui.TextDecorations`)—Defines the decorations of the text to display in the toolbar item. Default value is `None`.
* `HorizontalTextAlignment`(enum of type `Microsoft.Maui.TextAlignment`)—Defines the horizontal alignment of the text to display in the toolbar item. The default value is `Start`.
* `VerticalTextAlignment`(enum of type `Microsoft.Maui.TextAlignment`)—Defines the vertical alignment of the text to display in the toolbar item. Default value is `Center`.
* `ImageSource`(`Microsoft.Maui.Controls.ImageSource`)—Defines the source of the image displayed in the toolbar item.
* `ImageAspect`(enum of type `Microsoft.Maui.Aspect`)—Defines the aspect ratio of the image displayed in the toolbar item. Default value is `Center`.
* `ImageWidth`(`double`)—Defines the width in pixels of the image displayed in the toolbar item. Default value is `-1.0`.
* `ImageHeight`(`double`)—Defines the height in pixels of the image displayed in the toolbar item. Default value is `-1.0`.
* `ImageSpacing`(`double`)—Defines the spacing in pixels between the image and the text displayed in the toolbar item. Default value is `8.0`.
* `DisplayOptions`(enum of type `Telerik.Maui.Controls.ToolbarItemDisplayOptions`) property allows you to display text, image in the toolbar or in a combination of both. The options are `Text` and `Image`. This enum type supports a bitwise combination of its members to enable more than one option.

Position the image relative to the text in the toolbar item by setting the `ImagePosition`(enum of type `Telerik.Maui.Controls.ToolbarItemImagePosition`). The available options are:
\* `Left`—The image is displayed to the left of the text.
\* `Top`—The image is displayed at the top of the text.
\* `Right`—The image is displayed to the right of the text.
\* `Bottom`—The image is displayed at the bottom of the text.

* `HorizontalContentOptions`(enum of type `Microsoft.Maui.Controls.LayoutOptions`)—Specifies the horizontal alignment options of the content displayed in the toolbar item.
* `VerticalContentOptions`(enum of type `Microsoft.Maui.Controls.LayoutOptions`)—Specifies the vertical alignment options of the content displayed in the toolbar item.

All other properties that can be applied through style are the properties applicable for [ToolbarItemView](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/overview#styling).

> caption Here is an example of how to style the `LabelToolbarItem` and setting the visual states:

```XAML
<Style TargetType="telerik:LabelToolbarItemView" x:Key="labelItemStyle">
    <Setter Property="VisualStateManager.VisualStateGroups">
        <VisualStateGroupList>
            <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal">
                    <VisualState.Setters>
                        <Setter Property="TextColor" Value="#0A5CBF" />
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="PointerOver">
                    <VisualState.Setters>
                        <Setter Property="TextColor" Value="#1188FF" />
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="Disabled">
                    <VisualState.Setters>
                        <Setter Property="TextColor" Value="#B0B0B0" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateGroupList>
    </Setter>
</Style>
```

## See Also

* [SplitButton ToolbarItem](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/split-button)
* [ToggleButton ToolbarItem](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/toggle-button)
* [NavigationButton ToolbarItem](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/navigation-button)
* [ListPicker ToolbarItem](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/listpicker-button)
* [Group ToolbarItem](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/group)
* [RadioButton ToolbarItem](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/radio-button)
* [Slider ToolbarItem](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/slider)
