Skip to content
On this page

FAB

Floating action buttons (FABs) help people take primary actions.

  • Use a FAB for the most common or important action on a screen.

  • Make sure the icon in a FAB is clear and understandable.

  • FABs persist on the screen when content is scrolling.

  • Three styles: SecondaryFABStyle, SurfaceFABStyle and TertiaryFABStyle.

Examples

xml
<...
	xmlns:icon="clr-namespace:IconPacks.IconKind;assembly=IconPacks.Material"
...>

<mdc:FAB IconData="{Static icon:Material.Add}" Style="{DynamicResource SecondaryFABStyle}" />
<mdc:FAB IconData="{Static icon:Material.Add}" Style="{DynamicResource SurfaceFABStyle}" />
<mdc:FAB IconData="{Static icon:Material.Add}" Style="{DynamicResource TertiaryFABStyle}" />

Properties

nametypedefalut
IconDatastring
BackgroundColorColorstyle
ShapeShapeLarge
ElevationElevationLevel3
StateLayerColorColorstyle
RippleDurationfloat0.5
RippleEasingEasingSinInOut
ContextMenuContextMenu
StyleStyleSurface
CommandICommand
CommandParameterobject

Events

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