Skip to main content
A Floating Action Button (FAB) performs the primary, or most common, action on a screen.

Import

import Fab from '@mui/material/Fab';

Basic Usage

import Box from '@mui/material/Box';
import Fab from '@mui/material/Fab';
import AddIcon from '@mui/icons-material/Add';
import EditIcon from '@mui/icons-material/Edit';
import FavoriteIcon from '@mui/icons-material/Favorite';
import NavigationIcon from '@mui/icons-material/Navigation';

export default function FloatingActionButtons() {
  return (
    <Box sx={{ '& > :not(style)': { m: 1 } }}>
      <Fab color="primary" aria-label="add">
        <AddIcon />
      </Fab>
      <Fab color="secondary" aria-label="edit">
        <EditIcon />
      </Fab>
      <Fab variant="extended">
        <NavigationIcon sx={{ mr: 1 }} />
        Navigate
      </Fab>
      <Fab disabled aria-label="like">
        <FavoriteIcon />
      </Fab>
    </Box>
  );
}

Props

variant
'circular' | 'extended'
default:"'circular'"
The variant to use. extended allows for text labels alongside icons.
color
'default' | 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning'
default:"'default'"
The color of the component. Supports both default and custom theme colors.
size
'small' | 'medium' | 'large'
default:"'large'"
The size of the component. small is equivalent to the dense button styling.
disabled
boolean
default:"false"
If true, the component is disabled.
disableFocusRipple
boolean
default:"false"
If true, the keyboard focus ripple is disabled.
disableRipple
boolean
If true, the ripple effect is disabled.
href
string
The URL to link to when the button is clicked. If defined, an a element will be used as the root node.
sx
SxProps<Theme>
The system prop that allows defining system overrides as well as additional CSS styles.
children
ReactNode
The content of the component.

API Reference

Build docs developers (and LLMs) love