FloatingActionButton Appearance
The FloatingActionButton provides predefined appearance options such as different sizes and theme colors.
The following example demonstrates all available appearance options of the FloatingActionButton in action.
Size
The FloatingActionButton allows you to set different padding
to the internal content. To achieve this utilize the size
property. It accepts values of type ButtonSize
or none
.
The size
option supports the following values:
small
—Sets thepadding
to8px
.medium
(Default)—Sets thepadding
to16px
.large
—Sets thepadding
to24px
.none
—The none option removes the built-in sizing. Allows for custompadding
.
The following example demonstrates how to define the size of the FloatingActionButton.
Roundness
The FloatingActionButton enables you to apply different border radius
to the component through the rounded
property. It accepts values of type ButtonRounded
or none
.
The rounded
option supports the following values:
small
—Sets theborder radius
to1px
.medium
—Sets theborder radius
to2px
.large
—Sets theborder radius
to4px
.full
(Default)—Sets theborder radius
to9999px
. This would make the FloatingActionButton fully rounded. Depending on its content, it will render as a circle or pill respectively.none
—The none option removes the built-in roundness. Allows for customborder radius
.
The following example demonstrates how to define the border radius of the FloatingActionButton.
Theme Colors
The FloatingActionButton allows you to specify predefined theme colors. The theme color will be applied as a background and border color while also amending the text color accordingly.
The available themeColor
values are:
primary
(Default)—Applies coloring based on theprimary
theme color.secondary
—Applies coloring based on thesecondary
theme color.tertiary
—Applies coloring based on thetertiary
theme color.info
—Applies coloring based on theinfo
theme color.success
—Applies coloring based on thesuccess
theme color.warning
—Applies coloring based on thewarning
theme color.error
—Applies coloring based on theerror
theme color.dark
—Applies coloring based on thedark
theme color.light
—Applies coloring based on thelight
theme color.inverse
—Applies coloring based on theinverse
theme color.none
—Removes the color related styling.
The following example demonstrates how to specify the theme colors of the FloatingActionButton.