Skip to content
On this page

Button

Common buttons prompt most actions in a UI.

  • Can contain an optional leading icon.

  • Five styels: FilledButtonStyle, ElevatedButtonStyle, FilledTonalButtonStyle, OutlinedButtonStyle, and TextButtonStyle.

  • Keep labels concise and in sentence-case.

  • Containers have fully rounded corners and are wide enough to fit label text.

Examples

xml
<md:Button Style="{DynamicResource ElevatedButtonStyle}" Text="Elevated" />
<md:Button Style="{DynamicResource FilledButtonStyle}" Text="Filled" />
<md:Button Style="{DynamicResource FilledTonalButtonStyle}" Text="FilledTonal" />
<md:Button Style="{DynamicResource OutlinedButtonStyle}" Text="Outlined" />
<md:Button Style="{StaticResource TextButtonStyle}" Text="Text" />

Properties

nametypedefalut
Textstringempty
IconDatastringempty
BackgroundColorColorstyle
FontColorColorstyle
FontSizefloat14
FontFamilystring
FontWeightFontWeightRegular
FontIsItalicboolfalse
ShapeShapestyle
ElevationElevationstyle
OutlineWidthintstyle
OutlineColorColorstyle
StateLayerColorColorstyle
RippleDurationfloat0.5
RippleEasingEasingSinInOut
ContextMenuContextMenu
StyleStyleFilled
CommandICommand
CommandParameterobject

Events

nametype
ClickedEventHandler<TouchEventArgs>
PressedEventHandler<TouchEventArgs>
ReleasedEventHandler<TouchEventArgs>
LongPressedEventHandler<TouchEventArgs>
RightClicked ( desktop only )EventHandler<TouchEventArgs>