跳到内容跳到内容

CardHeaderAPI

API reference docs for the React CardHeader component. 了解此导出模块的属性、CSS 和其他 API。

演示

导入

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

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

属性

原生组件的属性也可用。

名称类型默认值描述
actionnode-

要在卡片标题中显示的操作。

avatarnode-

要显示的 Avatar 元素。

classesobject-

覆盖或扩展应用于组件的样式。

有关更多详细信息,请参见下面的 CSS 类 API。

componentelementType-

用于根节点的组件。 可以是用于 HTML 元素的字符串或组件。

disableTypographyboolfalse

如果为 truesubheadertitle 将不会被 Typography 组件包裹。 这在通过使用 Typography 组件包裹 title 文本和可选的 subheader 文本来渲染替代的 Typography 变体时非常有用。

slotProps{ action?: func
| object, avatar?: func
| object, content?: func
| object, root?: func
| object, subheader?: func
| object, title?: func
| object }
{}

用于每个插槽内部的属性。

slots{ action?: elementType, avatar?: elementType, content?: elementType, root?: elementType, subheader?: elementType, title?: elementType }{}

用于每个插槽内部的组件。

subheadernode-

组件的内容。

subheaderTypographyPropsobject-

这些属性将转发到 subheader(只要 disableTypography 不是 true)。

sxArray<func
| object
| bool>
| func
| object
-

允许定义系统覆盖以及其他 CSS 样式的系统属性。

有关更多详细信息,请参阅 `sx` 页面

titlenode-

组件的内容。

titleTypographyPropsobject-

这些属性将转发到 title(只要 disableTypography 不是 true)。

ref 转发到根元素。

主题默认属性

您可以使用 MuiCardHeader 通过主题更改此组件的默认属性 with the theme

插槽

插槽名称类名默认组件描述
root.MuiCardHeader-root'div'渲染 root 插槽的组件。
avataravatar'div'渲染 avatar 插槽的组件。
actionaction'div'渲染 action 插槽的组件。
content.MuiCardHeader-content'div'渲染 content 插槽的组件。
titletitleTypography渲染 title 插槽的组件(只要 disableTypography 不是 true)。 请遵循本指南以了解有关此组件要求的更多信息。
subheadersubheaderTypography渲染 subheader 插槽的组件(只要 disableTypography 不是 true)。 请遵循本指南以了解有关此组件要求的更多信息。

源代码

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