logoAnt Design

⌘ K
  • 设计
  • 研发
  • 组件
  • 博客
  • 资源
  • 国内镜像
5.20.6
  • 组件总览
  • 通用
    • Button
      按钮
    • FloatButton
      悬浮按钮
      5.0.0
    • Icon
      图标
    • Typography
      排版
  • 布局
    • Divider
      分割线
    • Flex
      弹性布局
      5.10.0
    • Grid
      栅格
    • Layout
      布局
    • Space
      间距
  • 导航
    • Anchor
      锚点
    • Breadcrumb
      面包屑
    • Dropdown
      下拉菜单
    • Menu
      导航菜单
    • Pagination
      分页
    • Steps
      步骤条
  • 数据录入
    • AutoComplete
      自动完成
    • Cascader
      级联选择
    • Checkbox
      多选框
    • ColorPicker
      颜色选择器
      5.5.0
    • DatePicker
      日期选择框
    • Form
      表单
    • Input
      输入框
    • InputNumber
      数字输入框
    • Mentions
      提及
    • Radio
      单选框
    • Rate
      评分
    • Select
      选择器
    • Slider
      滑动输入条
    • Switch
      开关
    • TimePicker
      时间选择框
    • Transfer
      穿梭框
    • TreeSelect
      树选择
    • Upload
      上传
  • 数据展示
    • Avatar
      头像
    • Badge
      徽标数
    • Calendar
      日历
    • Card
      卡片
    • Carousel
      走马灯
    • Collapse
      折叠面板
    • Descriptions
      描述列表
    • Empty
      空状态
    • Image
      图片
    • List
      列表
    • Popover
      气泡卡片
    • QRCode
      二维码
      5.1.0
    • Segmented
      分段控制器
    • Statistic
      统计数值
    • Table
      表格
    • Tabs
      标签页
    • Tag
      标签
    • Timeline
      时间轴
    • Tooltip
      文字提示
    • Tour
      漫游式引导
      5.0.0
    • Tree
      树形控件
  • 反馈
    • Alert
      警告提示
    • Drawer
      抽屉
    • Message
      全局提示
    • Modal
      对话框
    • Notification
      通知提醒框
    • Popconfirm
      气泡确认框
    • Progress
      进度条
    • Result
      结果
    • Skeleton
      骨架屏
    • Spin
      加载中
    • Watermark
      水印
      5.1.0
  • 其他
    • Affix
      固钉
    • App
      包裹组件
      5.1.0
    • ConfigProvider
      全局化配置
    • Util
      工具类
      5.13.0

Card
卡片

通用卡片容器。
使用import{ Card }from"antd";
源码components/card
文档编辑此页

相关资源

Ant Design Charts
Ant Design Pro
Ant Design Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Landing-首页模板集
Scaffolds-脚手架市场
Umi-React 应用开发框架
dumi-组件/文档研发工具
qiankun-微前端框架
ahooks-React Hooks 库
Ant Motion-设计动效
国内镜像站点 🇨🇳

社区

Awesome Ant Design
Medium
Twitter
yuque logoAnt Design 语雀专栏
Ant Design 知乎专栏
体验科技专栏
seeconf logoSEE Conf-蚂蚁体验科技大会
加入我们

帮助

GitHub
更新日志
常见问题
报告 Bug
议题
讨论区
StackOverflow
SegmentFault

Ant XTech logo更多产品

yuque logo语雀-构建你的数字花园
AntV logoAntV-数据可视化解决方案
Egg logoEgg-企业级 Node.js 框架
Kitchen logoKitchen-Sketch 工具集
Galacean logoGalacean-互动图形解决方案
xtech logo蚂蚁体验科技
主题编辑器
Made with ❤ by
蚂蚁集团和 Ant Design 开源社区
loading

何时使用

最基础的卡片容器,可承载文字、列表、图片、段落,常用于后台概览页面。

代码演示

Default size card
More

Card content

Card content

Card content

Small size card
More

Card content

Card content

Card content

典型卡片

包含标题、内容、操作区域。

codepen icon
External Link Icon
expand codeexpand code
Card title

Card content

Card content

Card content

无边框

在灰色背景上使用无边框的卡片。

codepen icon
External Link Icon
expand codeexpand code

Card content

Card content

Card content

简洁卡片

只包含内容区域。

codepen icon
External Link Icon
expand codeexpand code
example
Europe Street beat
www.instagram.com
更灵活的内容展示

可以利用 Card.Meta 支持更灵活的内容。

codepen icon
External Link Icon
expand codeexpand code
Card title
Card content
Card title
Card content
Card title
Card content
栅格卡片

在系统概览页面常常和栅格进行配合。

codepen icon
External Link Icon
expand codeexpand code
预加载的卡片

数据读入前会有文本块样式。

codepen icon
External Link Icon
expand codeexpand code
Card Title
Content
Content
Content
Content
Content
Content
Content
网格型内嵌卡片

一种常见的卡片内容区隔模式。

codepen icon
External Link Icon
expand codeexpand code
Card title
Inner Card title
More
Inner Card content
Inner Card title
More
Inner Card content
内部卡片

可以放在普通卡片内部,展示多层级结构的信息。

codepen icon
External Link Icon
expand codeexpand code
Card title
More
tab1
tab2

content1



article
app
project
More

app content

带页签的卡片

可承载更多内容。

codepen icon
External Link Icon
expand codeexpand code
example
Card title
This is the description
支持更多内容配置

一种支持封面、头像、标题和描述信息的卡片。

codepen icon
External Link Icon
expand codeexpand code

API

通用属性参考:通用属性

<Card title="卡片标题">卡片内容</Card>
参数说明类型默认值版本
actions卡片操作组,位置在卡片底部Array<ReactNode>-
activeTabKey当前激活页签的 keystring-
bordered是否有边框booleantrue
cover卡片封面ReactNode-
defaultActiveTabKey初始化选中页签的 key,如果没有设置 activeTabKeystring第一个页签的 key
extra卡片右上角的操作区域ReactNode-
hoverable鼠标移过时可浮起booleanfalse
loading当卡片内容还在加载中时,可以用 loading 展示一个占位booleanfalse
sizecard 的尺寸default | smalldefault
tabBarExtraContenttab bar 上额外的元素ReactNode-
tabList页签标题列表TabItemType[]-
tabPropsTabs--
title卡片标题ReactNode-
type卡片类型,可设置为 inner 或 不设置string-
classNames配置卡片内置模块的 classNameRecord<SemanticDOM, string>-5.14.0
styles配置卡片内置模块的 styleRecord<SemanticDOM, CSSProperties>-5.14.0
onTabChange页签切换的回调(key) => void-

Card.Grid

参数说明类型默认值版本
className网格容器类名string-
hoverable鼠标移过时可浮起booleantrue
style定义网格容器类名的样式CSSProperties-

Card.Meta

参数说明类型默认值版本
avatar头像/图标ReactNode-
className容器类名string-
description描述内容ReactNode-
style定义容器类名的样式CSSProperties-
title标题内容ReactNode-

Semantic DOM

Card title
More
example
Card Meta title
This is the description
  • header
    5.14.0
    设置卡片头部区域
  • body
    5.14.0
    设置卡片内容区域
  • extra
    5.14.0
    设置卡片右上角的操作区域
  • title
    5.14.0
    设置卡片标题
  • actions
    5.14.0
    设置卡片底部操作组
  • cover
    5.14.0
    设置标题封面

主题变量(Design Token)

组件 Token如何定制?

Token 名称描述类型默认值
actionsBg操作区背景色string#ffffff
actionsLiMargin操作区每一项的外间距string12px 0
extraColor额外区文字颜色stringrgba(0, 0, 0, 0.88)
headerBg卡片头部背景色stringtransparent
headerFontSize卡片头部文字大小string | number16
headerFontSizeSM小号卡片头部文字大小string | number14
headerHeight卡片头部高度string | number56
headerHeightSM小号卡片头部高度string | number38
tabsMarginBottom内置标签页组件下间距number-17

全局 Token如何定制?