New to Telerik UI for .NET MAUI? Start a free 30-day trial

.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 in the toolbar item.
  • ImageAspect(enum of type Microsoft.Maui.Aspect)—Defines the aspect ratio of the image displayed in the in the toolbar item. Default value is Center.
  • ImageWidth(double)—Defines the width in pixels of the image displayed in the in the toolbar item. Default value is -1.0.
  • ImageHeight(double)—Defines the height in pixels of the image displayed in the 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 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.

See Also

In this article