logoAnt Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
YouMindTRACTIANLobeHubCodeRabbit
6.4.5
  • Components Overview
  • Changelog
    v6.4.5
  • General
    • Button
    • FloatButton
    • Icon
    • Typography
  • Layout
    • Divider
    • Flex
    • Grid
    • Layout
    • Masonry
      6.0.0
    • Space
    • Splitter
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
    • Tabs
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPicker
    • DatePicker
    • Form
    • Input
    • InputNumber
    • Mentions
    • Radio
    • Rate
    • Select
    • Slider
    • Switch
    • TimePicker
    • Transfer
    • TreeSelect
    • Upload
  • Data Display
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Collapse
    • Descriptions
    • Empty
    • Image
    • List
      DEPRECATED
    • Popover
    • QRCode
    • Segmented
    • Statistic
    • Table
    • Tag
    • Timeline
    • Tooltip
    • Tour
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
  • Other
    • Affix
    • App
    • BorderBeam
      6.4.0
    • ConfigProvider
    • Util
When To Use
Examples
Basic card
No border
Simple card
Customized content
Card in column
Loading card
Grid card
Inner card
With tabs
Support more content configuration
Custom semantic dom styling
API
Card.Grid
Card.Meta
Semantic DOM
Card
Card.Meta
Design Token

Card

A container for displaying information.
Importimport { Card } from 'antd';
GitHub
components/cardIssueOpen issues
Docs
Edit this pageLLMs.md
CalendarCarousel

Resources

Ant Design X
Ant Design Charts
Ant Design Pro
Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Web3
Ant Design Landing-Landing Templates
Scaffolds-Scaffold Market
Umi-React Application Framework
dumi-Component doc generator
qiankun-Micro-Frontends Framework
Ant Motion-Motion Solution
China Mirror 🇨🇳

Community

Awesome Ant Design
Medium
X
yuque logoAnt Design in YuQue
Ant Design in Zhihu
Experience Cloud Blog
seeconf logoSEE Conf-Experience Tech Conference

Help

GitHub
Change Log
FAQ
For Agents
Bug Report
Issues
Discussions
StackOverflow
SegmentFault

Ant XTech logoMore Products

yuque logoYuQue-Document Collaboration Platform
AntV logoAntV-Data Visualization
Egg logoEgg-Enterprise Node.js Framework
Kitchen logoKitchen-Sketch Toolkit
Galacean logoGalacean-Interactive Graphics Solution
WeaveFox logoWeaveFox-AI Development with WeaveFox 🦊
xtech logoAnt Financial Experience Tech
Theme Editor
Made with ❤ by
Ant Group and Ant Design Community
loading

When To Use

A card can be used to display content related to a single subject. The content can consist of multiple elements of varying types and sizes.

Examples

API

Common props ref:Common props

jsx
<Card title="Card title">Card content</Card>
PropertyDescriptionTypeDefaultVersionGlobal Config
actionsThe action list, shows at the bottom of the CardArray<ReactNode>-×
activeTabKeyCurrent TabPane's keystring-×
borderedToggles rendering of the border around the card, please use variant insteadbooleantrue×
bodyStyleStyle of card body, please use styles.body insteadCSSProperties--×
variantVariants of Cardoutlined | borderlessoutlined5.24.05.24.0
classNamesCustomize class for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string>-5.14.0
coverCard coverReactNode-×
defaultActiveTabKeyInitial active TabPane's key, if activeTabKey is not setstringThe key of first tab×
extraContent to render in the top-right corner of the cardReactNode-×
hoverableLift up when hovering cardbooleanfalse×
headStyleStyle of card head, please use styles.header insteadCSSProperties--×
loadingShows a loading indicator while the contents of the card are being fetchedbooleanfalse×
sizeSize of cardmedium | smallmedium×
tabBarExtraContentExtra content in tab barReactNode-×
tabListList of TabPane's headTabItemType[]-×
tabPropsTabs--×
titleCard titleReactNode-×
typeCard style type, can be set to inner or not setstring-×
stylesCustomize inline style for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties>-5.14.0
onTabChangeCallback when tab is switched(key) => void-×

Card.Grid

PropertyDescriptionTypeDefaultVersion
hoverableLift up when hovering card gridbooleantrue

Card.Meta

PropertyDescriptionTypeDefaultVersionGlobal Config
avatarAvatar or iconReactNode-×
descriptionDescription contentReactNode-×
titleTitle contentReactNode-×

Semantic DOM

Card

Card.Meta

Design Token

Component TokenHow to use?
Token NameDescriptionTypeDefault Value
actionsBgBackground color of card actionsstring#ffffff
actionsLiMarginMargin of each item in card actionsstring12px 0
bodyPaddingPadding of card bodynumber24
bodyPaddingSMPadding of small card bodynumber12
extraColorText color of extra areastringrgba(0,0,0,0.88)
headerBgBackground color of card headerstringtransparent
headerFontSizeFont size of card headerstring | number16
headerFontSizeSMFont size of small card headerstring | number14
headerHeightHeight of card headerstring | number56
headerHeightSMHeight of small card headerstring | number38
headerPaddingPadding of card headnumber24
headerPaddingSMPadding of small card headnumber12
tabsMarginBottomMargin bottom of tabs componentnumber-17
Global TokenHow to use?
Token NameDescriptionTypeDefault Value
colorBgContainerContainer background color, e.g: default button, input box, etc. Be sure not to confuse this with `colorBgElevated`.string#ffffff
colorBorderSecondarySlightly lighter than the default border color, this color is the same as `colorSplit`. Solid color is used.string#f0f0f0
colorFillAlterControl the alternative background color of element.stringrgba(0,0,0,0.02)
colorIconWeak action. Such as `allowClear` or Alert close buttonstringrgba(0,0,0,0.45)
colorPrimaryBrand color is one of the most direct visual elements to reflect the characteristics and communication of the product. After you have selected the brand color, we will automatically generate a complete color palette and assign it effective design semantics.string#1677ff
colorTextDefault text color which comply with W3C standards, and this color is also the darkest neutral color.stringrgba(0,0,0,0.88)
colorTextDescriptionControl the font color of text description.stringrgba(0,0,0,0.45)
colorTextHeadingControl the font color of heading.stringrgba(0,0,0,0.88)
borderRadiusLGLG size border radius, used in some large border radius components, such as Card, Modal and other components.number8
boxShadowTertiaryControl the tertiary box shadow style of an element.string 0 1px 2px 0 rgba(0,0,0,0.05), 0 1px 6px -1px rgba(0,0,0,0.03), 0 2px 4px 0 rgba(0,0,0,0.03)
fontFamilyThe font family of Ant Design prioritizes the default interface font of the system, and provides a set of alternative font libraries that are suitable for screen display to maintain the readability and readability of the font under different platforms and browsers, reflecting the friendly, stable and professional characteristics.string-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'
fontSizeThe most widely used font size in the design system, from which the text gradient will be derived.number14
fontSizeLGLarge font sizenumber16
fontWeightStrongControl the font weight of heading components (such as h1, h2, h3) or selected item.number600
lineHeightLine height of text.number1.5714285714285714
lineTypeBorder style of base componentsstringsolid
lineWidthBorder width of base componentsnumber1
marginXSControl the margin of an element, with a small size.number8
marginXXSControl the margin of an element, with the smallest size.number4
motionDurationMidMotion speed, medium speed. Used for medium element animation interaction.string0.2s
paddingControl the padding of the element.number16
paddingLGControl the large padding of the element.number24
Basic card

A basic card containing a title, content and an extra corner content. Supports two sizes: medium and small.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
No border

A borderless card on a gray background.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Simple card

A simple card only containing a content area.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Customized content

You can use Card.Meta to support more flexible content.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Card in column

Cards usually cooperate with grid column layout in overview page.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Loading card

Shows a loading indicator while the contents of the card is being fetched.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Grid card

Grid style card content.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Inner card

It can be placed inside the ordinary card to display the information of the multilevel structure.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
With tabs

More content can be hosted.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Support more content configuration

A Card that supports cover, avatar, title and description.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Custom semantic dom styling

You can customize the semantic dom style of Card by passing objects/functions through classNames and styles.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
6.0.0
Default size card
More

Card content

Card content

Card content

Small size card
More

Card content

Card content

Card content

Card title

Card content

Card content

Card content

Card content

Card content

Card content

example
Europe Street beat
www.instagram.com
Card title
Card content
Card title
Card content
Card title
Card content
Card Title
Content
Content
Content
Content
Content
Content
Content
Card title
Inner Card title
More
Inner Card content
Inner Card title
More
Inner Card content
Card title
More
tab1
tab2

content1



article
app
project
More

app content

example
Card title
This is the description
Object Card
Object Card Meta title
This is the description
Function Card
Function Card Meta title
This is the description
Card title
More
example
Card Meta title
This is the description
  • root
    6.0.0
    Card root element with positioning, background, border, border-radius, box-shadow, padding and other container styles
  • header
    5.14.0
    Card header area with flex layout, min-height, padding, text color, font-weight, font-size, background, bottom border and top border-radius
  • title
    5.14.0
    Card title with inline-block display, flex-grow, text ellipsis and other title display styles
  • extra
    5.14.0
    Card extra operation area in top-right corner with text color and layout styles for additional content
  • cover
    5.14.0
    Title cover with styles for cover image display and layout
  • body
    5.14.0
    Card content area with padding, font-size and other content display styles
  • actions
    5.14.0
    Card bottom action group with flex layout, list-style reset, background, top border and bottom border-radius for action buttons container
Card Meta title
This is the description
  • root
    6.0.0
    set `root` of Card.Meta
  • section
    6.0.0
    set `section` of Card.Meta
  • avatar
    6.0.0
    set `avatar` of Card.Meta
  • title
    6.0.0
    set `title` of Card.Meta
  • description
    6.0.0
    set `description` of Card.Meta