跳到主要内容跳到主要内容

FadeAPI

React Fade 组件的 API 参考文档。了解此导出的模块的 props、CSS 和其他 API。

演示

导入

import Fade from '@mui/material/Fade';
// or
import { Fade } from '@mui/material';

阅读关于最小化 bundle size 的指南,了解它们之间的区别。



Fade 过渡效果由 Modal 组件使用。它在内部使用 react-transition-group

Props

Transition 组件的 Props 也可用。

名称类型默认值描述
children*element-

单个子内容元素。

addEndListenerfunc-

添加自定义过渡结束触发器。使用过渡 DOM 节点和 done 回调调用。允许更精细的过渡结束逻辑。注意:如果提供,超时仍用作后备。

appearbooltrue

如果 in 也为 true,则在首次挂载时执行进入过渡。设置为 false 以禁用此行为。

easing{ enter?: string, exit?: string }
| string
-

过渡 timing 函数。您可以指定单个 easing 或包含 enter 和 exit 值的对象。

inbool-

如果 true,组件将过渡进入。

timeoutnumber
| { appear?: number, enter?: number, exit?: number }
{ enter: theme.transitions.duration.enteringScreen, exit: theme.transitions.duration.leavingScreen, }

过渡的持续时间,以毫秒为单位。您可以为所有过渡指定单个超时,也可以使用对象单独指定。

ref 被转发到根元素。

继承

虽然上面没有明确文档说明,但来自 react-transition-group 的 Transition 组件的 props 也在 Fade 中可用。您可以利用它来定位嵌套组件

源代码

如果您在此页面中找不到信息,请考虑查看组件的实现以获取更多详细信息。