Card 卡片

将信息聚合在卡片容器中展示。

基础用法

卡片包含标题,内容以及操作区域。

Card 组件由 header body 和 footer组成。 header 和 footer是可选的,其内容取决于一个具名的 slot。

Card name

List item 1

List item 2

List item 3

List item 4

简单卡片

卡片可以只有内容区域。

List item 1

List item 2

List item 3

List item 4

有图片内容的卡片

可配置定义更丰富的内容展示。

配置 body-style 属性来自定义 body 部分的样式。

Yummy hamburger

带有阴影效果的卡片

你可以定义什么时候展示卡片的阴影效果。

通过 shadow 属性设置卡片阴影出现的时机。该属性的值可以是:always、hover 或 never。

Always
Hover
Never

Card API

Card Attributes

属性名说明类型默认值
header标题,也可传入节点string / ReactNode—
footer页脚,也可传入节点string / ReactNode—
body-style内容区样式object—
header-class自定义头部类名string—
body-class自定义内容区类名string—
footer-class自定义页脚类名string—
shadow阴影显示时机enumalways

Card Slots

插槽名说明React 写法
default内容区children
header头部内容header
footer页脚内容footer