跳转到内容

Backdrop

背景暗化组件用于提供针对特定元素或这个元素一部分的强调。

The backdrop signals to the user of a state change within the application and can be used for creating loaders, dialogs, and more. 在最简单的情况下,背景暗化组件将在您的应用程序上添加一个暗淡的图层。

示例

<Button onClick={handleToggle}>Show backdrop</Button>
<Backdrop
  sx={{ color: '#fff', zIndex: (theme) => theme.zIndex.drawer + 1 }}
  open={open}
  onClick={handleClose}
>
  <CircularProgress color="inherit" />
</Backdrop>

Unstyled

The backdrop also comes with the unstyled package. It's ideal for doing heavy customizations and minimizing bundle size.

import Backdrop from '@material-ui/unstyled/Backdrop';