Floating Action Button
A Floating Action Button (FAB) performs the primary, or most common, action on a screen.
A floating action button appears in front of all screen content, typically as a circular shape with an icon in its center. FABs come in two types: regular, and extended.
Only use a FAB if it is the most suitable way to present a screen's primary action. Only one component is recommended per screen to represent the most common action.
Basic
Variants
<x-mbc::fab icon="add" variant="regular" />
<x-mbc::fab icon="add" variant="mini" />
Extended
<x-mbc::fab label="Order" />
<x-mbc::fab icon="add" label="Create" />
Properties
mbc::fab
| Name | Type | Default | Description |
|---|---|---|---|
color
|
theme color | css color | string
|
'secondary'
|
The color of the FAB. |
disabled
|
bool
|
false
|
If true, the FAB will be disabled. |
icon
|
string
|
null
|
The icon to display. |
label
|
string
|
null
|
The label to display. |
variant
|
'regular' | 'mini' | string
|
'regular'
|
The variant of the FAB. |
References
-
https://mui.com/material-ui/react-floating-action-button/
-
https://m2.material.io/components/buttons-floating-action-button/web
-
https://github.com/material-components/material-components-web/blob/v14.0.0/packages/mdc-fab/README.md
-
https://material-components.github.io/material-components-web-catalog/#/component/fab