Card

A container for displaying information.
Importimport{ Card }from"antd";

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

Default size card

Card content

Card content

Card content

Small size card

Card content

Card content

Card content

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

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Card title

Card content

Card content

Card content

A borderless card on a gray background.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code

Card content

Card content

Card content

A simple card only containing a content area.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
example
Europe Street beat
www.instagram.com

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

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Card title
Card content
Card title
Card content
Card title
Card content

Cards usually cooperate with grid column layout in overview page.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code

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

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Card Title
Content
Content
Content
Content
Content
Content
Content

Grid style card content.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Card title
Inner Card title
Inner Card content
Inner Card title
Inner Card content

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

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Card title

content1



app content

More content can be hosted.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
example
Card title
This is the description

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

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code

API

Common props ref:Common props

<Card title="Card title">Card content</Card>
PropertyDescriptionTypeDefaultVersion
actionsThe action list, shows at the bottom of the CardArray<ReactNode>-
activeTabKeyCurrent TabPane's keystring-
borderedToggles rendering of the border around the cardbooleantrue
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
loadingShows a loading indicator while the contents of the card are being fetchedbooleanfalse
sizeSize of carddefault | smalldefault
tabBarExtraContentExtra content in tab barReactNode-
tabListList of TabPane's headTabItemType[]-
tabPropsTabs--
titleCard titleReactNode-
typeCard style type, can be set to inner or not setstring-
classNamesConfig Card build-in module's classNameRecord<SemanticDOM, string>-5.14.0
stylesConfig Card build-in module's styleRecord<SemanticDOM, CSSProperties>-5.14.0
onTabChangeCallback when tab is switched(key) => void-

Card.Grid

PropertyDescriptionTypeDefaultVersion
classNameThe className of containerstring-
hoverableLift up when hovering card gridbooleantrue
styleThe style object of containerCSSProperties-

Card.Meta

PropertyDescriptionTypeDefaultVersion
avatarAvatar or iconReactNode-
classNameThe className of containerstring-
descriptionDescription contentReactNode-
styleThe style object of containerCSSProperties-
titleTitle contentReactNode-

Semantic DOM

Card title
More
example
Card Meta title
This is the description
  • header
    5.14.0
    set `header` of card
  • title
    5.14.0
    set `title` of card
  • extra
    5.14.0
    set `extra` of card
  • cover
    5.14.0
    set `cover` of card
  • body
    5.14.0
    set `body` of card
  • actions
    5.14.0
    set `actions` of card

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?