A toolbar control with support for left icons, right icons, title, icon groups, and overflow handling. Follows Material Design patterns with automatic responsive overflow menus.
Basic Usage
// Simple toolbar with titlenewToolbar().SetTitle("My App").SetDesiredHeight(56)// Toolbar with iconsnewToolbar().SetTitle("My App").AddLeft(newButton().SetIcon("menu")).AddRight(newButton().SetIcon("search")).AddRight(newButton().SetIcon("more_vert"))// Responsive overflow handlingnewToolbar().SetTitle("Editor").AddRight(newButton().SetText("Save")).AddRight(newButton().SetText("Export")).AddRight(newButton().SetText("Share")).SetOverflowBehavior(OverflowBehavior.CollapseToMenu)
Toolbar-Specific Methods
Title Methods
Method
Description
SetTitle(string)
Sets toolbar title
BindTitle(name, getter)
Binds title
SetTitleFontSize(float)
Sets title font size (default: 20)
BindTitleFontSize(name, getter)
Binds title font size
SetTitleColor(Color)
Sets title color (default: black)
BindTitleColor(name, getter)
Binds title color
SetTitleAlignment(TitleAlignment)
Sets title alignment (default: Center)
BindTitleAlignment(name, getter)
Binds title alignment
TitleAlignment Values
Value
Description
TitleAlignment.Center
Title centered (default)
TitleAlignment.Left
Title aligned left
Content Methods
Method
Description
AddLeft(UiElement)
Adds element to left section
AddLeftGroup(ToolbarIconGroup)
Adds icon group to left section
AddRight(UiElement)
Adds element to right section
AddRightGroup(ToolbarIconGroup)
Adds icon group to right section
SetCenterContent(UiElement)
Sets center content (replaces title)
BindCenterContent(name, getter)
Binds center content
Layout Methods
Method
Description
SetItemSpacing(float)
Sets spacing between items (default: 8)
BindItemSpacing(name, getter)
Binds item spacing
SetContentPadding(Margin)
Sets content padding (default: 16, 0, 16, 0)
BindContentPadding(name, getter)
Binds content padding
Overflow Methods
Method
Description
SetOverflowBehavior(OverflowBehavior)
Sets overflow behavior (default: None)
BindOverflowBehavior(name, getter)
Binds overflow behavior
SetOverflowThreshold(float)
Sets width at which overflow starts (default: 600)
BindOverflowThreshold(name, getter)
Binds overflow threshold
SetOverflowIcon(string)
Sets overflow menu icon (default: “more_vert”)
BindOverflowIcon(name, getter)
Binds overflow icon
OverflowBehavior Values
Value
Description
OverflowBehavior.None
No overflow handling (default)
OverflowBehavior.CollapseToMenu
Collapse excess items to overflow menu
Overflow Menu Styling
Method
Description
SetOverflowMenuBackground(Color)
Sets overflow menu background
BindOverflowMenuBackground(name, getter)
Binds menu background
SetOverflowMenuItemBackground(Color)
Sets menu item background
BindOverflowMenuItemBackground(name, getter)
Binds item background
SetOverflowMenuItemHoverBackground(Color)
Sets menu item hover background
BindOverflowMenuItemHoverBackground(name, getter)
Binds item hover background
SetOverflowMenuItemTextColor(Color)
Sets menu item text color
BindOverflowMenuItemTextColor(name, getter)
Binds item text color
Toolbar has AccessibilityRole.Toolbar by default. When overflow behavior is enabled, items that don’t fit are moved to a dropdown menu.
ToolbarIconGroup
Groups related toolbar icons together with optional separator.
Method
Description
AddIcon(Button)
Adds an icon button to the group
SetSeparator(bool)
Adds visual separator after group
SetPriority(int)
Sets priority for overflow (higher = kept visible)