Button Family
ButtonGroup, floating action button, FAB menu, split button and menu button
The Button page covers the base control. This page documents the rest of the button family: grouped buttons, floating action buttons with expandable menus, split buttons and menu buttons.
On this page
Button Groups
Segmented rows of related actions.
ButtonGroup
A Material Design 3.0 Button Group component that arranges buttons in horizontal, vertical, or grid layouts.
| Member | Kind | Description |
|---|---|---|
ButtonGroupLayout Layout | Property | Gets or sets the layout direction of the button group. |
ButtonGroupVariant Variant | Property | Gets or sets the button group variant (Material Design 3.0). |
float Spacing | Property | Gets or sets the spacing between buttons in pixels. |
float ButtonWidth | Property | Gets or sets the default width for buttons in the group. |
float ButtonHeight | Property | Gets or sets the default height for buttons in the group. |
bool EqualWidth | Property | Gets or sets whether all buttons should have equal width. |
SKColor GroupBackgroundColor | Property | Gets or sets the background color of the button group. |
float CornerRadius | Property | Gets or sets the corner radius of the button group. |
IReadOnlyList<Button> Buttons | Property | Gets the collection of buttons in the group. |
ButtonGroup() | Method | Initializes a new instance of the ButtonGroup class. |
void AddButton(Button button) | Method | Adds a button to the group. The button to add. |
bool RemoveButton(Button button) | Method | Removes a button from the group. The button to remove. True if the button was removed; otherwise, false. |
static ButtonGroup CreateHorizontalGroup(params string[] buttonTexts) | Method | Creates a simple horizontal button group with the specified button texts. The texts for the buttons. A configured ButtonGroup instance. |
static ButtonGroup CreateVerticalGroup(params string[] buttonTexts) | Method | Creates a vertical button group with the specified button texts. The texts for the buttons. A configured ButtonGroup instance. |
static ButtonGroup CreateButtonGrid(string[] buttonTexts, int columns) | Method | Creates a button grid with the specified button texts and grid dimensions. The texts for the buttons. The number of columns in the grid. A configured ButtonGroup instance. |
Floating Action Buttons
Primary action buttons with expandable menus.
FloatingActionButton
A Material Design 3.0 Floating Action Button (FAB) component.
| Member | Kind | Description |
|---|---|---|
string Icon | Property | Gets or sets the icon displayed on the FAB (SVG path or Unicode character). |
SKColor BackgroundColor | Property | Gets or sets the background color of the FAB. |
SKColor IconColor | Property | Gets or sets the icon color of the FAB. |
FabSize Size | Property | Gets or sets the size of the FAB. |
FabType Type | Property | Gets or sets the type of the FAB. |
string ExtendedText | Property | Gets or sets the extended text for extended FAB. |
FloatingActionButton() | Method | Initializes a new instance of the FloatingActionButton class. |
FloatingActionButton(string icon) | Method | Initializes a new instance of the FloatingActionButton class with an icon. The icon to display. |
override bool ContainsPoint(SKPoint point) | Method | Determines whether the specified point is contained within the FAB. The point to test. True if the point is contained within the FAB. |
new bool HandleMouseDown(SKPoint point, InteractionContext context) | Method | Public wrapper for mouse down events (used by demos). |
new bool HandleMouseMove(SKPoint point, InteractionContext context) | Method | Public wrapper for mouse move events (used by demos). |
FabMenu
A Material Design 3.0 Floating Action Button Menu component. Provides a main FAB that opens a menu with multiple action items.
| Member | Kind | Description |
|---|---|---|
event EventHandler<FabMenuItemEventArgs> MenuItemClicked | Event | Occurs when a menu item is clicked. |
event EventHandler MenuOpened | Event | Occurs when the menu is opened. |
event EventHandler MenuClosed | Event | Occurs when the menu is closed. |
FabMenu() | Method | Initializes a new instance of the FabMenu class. |
string MainIcon | Property | Gets or sets the main FAB icon. |
FloatingActionButton.FabType MainFabType | Property | Gets or sets the main FAB type. |
FabMenuDirection Direction | Property | Gets or sets the menu direction. |
float ItemSpacing | Property | Gets or sets the spacing between menu items. |
SKColor OverlayColor | Property | Gets or sets the overlay color when the menu is open. |
bool IsOpen | Property | Gets whether the menu is currently open. |
bool IsAnimating | Property | Gets whether the menu is currently animating. |
void AddMenuItem(FabMenuItem item) | Method | Adds a menu item to the FAB menu. The menu item to add. |
void RemoveMenuItem(FabMenuItem item) | Method | Removes a menu item from the FAB menu. The menu item to remove. |
void ClearMenuItems() | Method | Clears all menu items. |
void OpenMenu() | Method | Opens the FAB menu. |
void CloseMenu() | Method | Closes the FAB menu. |
void ToggleMenu() | Method | Toggles the FAB menu open/closed state. |
override bool ContainsPoint(SKPoint point) | Method | Determines whether the specified point is contained within the FAB menu. The point to test. True if the point is contained within the FAB menu. |
FabMenuItem
Represents a menu item in the FAB menu.
Split and Menu Buttons
Buttons that combine a primary action with a menu.
SplitButton
A Material Design 3.0 Split Button component that combines a primary action with a dropdown menu of additional options.
| Member | Kind | Description |
|---|---|---|
string Text | Property | Gets or sets the text displayed on the primary button. |
string SelectedText | Property | Gets the text of the currently selected menu item. |
SKColor BackgroundColor | Property | Gets or sets the background color of the primary button. |
new SKColor TextColor | Property | Gets or sets the text color of the primary button. |
SKColor DropdownButtonColor | Property | Gets or sets the background color of the dropdown button. |
SKColor DropdownTextColor | Property | Gets or sets the text color of the dropdown button. |
float CornerRadius | Property | Gets or sets the corner radius of the split button. |
ButtonVariant Variant | Property | Gets or sets the button variant (Material Design 3.0). |
string LeadingIcon | Property | Gets or sets the leading icon (SVG path or resource name). |
string DropdownIcon | Property | Gets or sets the dropdown icon. |
bool IsDropdownOpen | Property | Gets or sets whether the dropdown menu is open. |
float SeparatorWidth | Property | Gets or sets the width of the separator between the primary and dropdown buttons. |
SKColor SeparatorColor | Property | Gets or sets the color of the separator between the primary and dropdown buttons. |
SplitButtonItem SelectedItem | Property | Gets the currently selected menu item. |
IReadOnlyList<SplitButtonItem> MenuItems | Property | Gets the collection of menu items. |
event EventHandler<EventArgs> PrimaryButtonClicked | Event | Occurs when the primary button is clicked. |
event EventHandler<EventArgs> DropdownButtonClicked | Event | Occurs when the dropdown button is clicked. |
event EventHandler<SplitButtonItemSelectedEventArgs> ItemSelected | Event | Occurs when a menu item is selected. |
event EventHandler<EventArgs> DropdownStateChanged | Event | Occurs when the dropdown state changes. |
SplitButton() | Method | Initializes a new instance of the SplitButton class. |
SplitButtonItem AddMenuItem(string text, string icon = null) | Method | Adds a menu item to the dropdown. The text for the menu item. The icon for the menu item (optional). The created SplitButtonItem. |
bool RemoveMenuItem(SplitButtonItem item) | Method | Removes a menu item from the dropdown. The menu item to remove. True if the item was removed successfully. |
void ClearMenuItems() | Method | Clears all menu items from the dropdown. |
void SelectItem(SplitButtonItem item) | Method | Selects a menu item. The menu item to select. |
void SelectItem(int index) | Method | Selects a menu item by index. The index of the menu item to select. |
static SplitButton Create(string primaryText, params string[] menuItems) | Method | Creates a new SplitButton instance with the specified menu items. The text for the primary button. The menu items for the dropdown. A new SplitButton instance. |
static SplitButton CreateFilled(string primaryText, params string[] menuItems) | Method | Creates a new SplitButton instance with filled variant. The text for the primary button. The menu items for the dropdown. A new SplitButton instance. |
static SplitButton CreateOutlined(string primaryText, params string[] menuItems) | Method | Creates a new SplitButton instance with outlined variant. The text for the primary button. The menu items for the dropdown. A new SplitButton instance. |
MenuButton
A Material Design 3.0 Menu Button component that combines a button with a dropdown menu.
| Member | Kind | Description |
|---|---|---|
string Text | Property | Gets or sets the text displayed on the button. |
string Icon | Property | Gets or sets the icon displayed on the button. |
Menu Menu | Property | Gets or sets the dropdown menu. |
bool IsMenuOpen | Property | Gets whether the dropdown menu is currently open. |
SKColor ButtonColor | Property | Gets or sets the button color. |
SKColor HoverColor | Property | Gets or sets the hover color. |
SKColor PressedColor | Property | Gets or sets the pressed color. |
float CornerRadius | Property | Gets or sets the corner radius of the button. |
ButtonVariant Variant | Property | Gets or sets the button variant. |
event EventHandler ButtonClicked | Event | Occurs when the button is clicked. |
event EventHandler MenuOpened | Event | Occurs when the menu is opened. |
event EventHandler MenuClosed | Event | Occurs when the menu is closed. |
MenuButton() | Method | Initializes a new instance of the MenuButton class. |
MenuButton(string text) : this() | Method | Initializes a new instance of the MenuButton class with the specified text. The text to display on the button. |
MenuButton(string text, Menu menu) : this(text) | Method | Initializes a new instance of the MenuButton class with the specified text and menu. The text to display on the button. The dropdown menu. |
void OpenMenu() | Method | Opens the dropdown menu. |
void CloseMenu() | Method | Closes the dropdown menu. |
void ToggleMenu() | Method | Toggles the dropdown menu open/closed state. |
new bool HandleMouseDown(SKPoint point, InteractionContext context) | Method | Public wrapper for mouse down events (used by demos). |