Card

Simple rectangular container

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 type and size.

Examples

Card title

Card content

Card content

Card content

A basic card containing a title, content and an extra corner content.

import { Card } from 'antd';

ReactDOM.render(
  <Card title="Card title" extra={<a href="#">More</a>} style={{ width: 300 }}>
    <p>Card content</p>
    <p>Card content</p>
    <p>Card content</p>
  </Card>
, mountNode);

Card title

Card content

Card content

Card content

A borderless card on a gray background.

import { Card } from 'antd';

ReactDOM.render(
  <div style={{ background: '#ECECEC', padding: '30px' }}>
    <Card title="Card title" bordered={false} style={{ width: 300 }}>
      <p>Card content</p>
      <p>Card content</p>
      <p>Card content</p>
    </Card>
  </div>
, mountNode);

Card content

Card content

Card content

A simple card only containing a content area.

import { Card } from 'antd';

ReactDOM.render(
  <Card style={{ width: 300 }}>
    <p>Card content</p>
    <p>Card content</p>
    <p>Card content</p>
  </Card>
, mountNode);
example

Europe Street beat

www.instagram.com

Customizing default width and margin.

import { Card } from 'antd';

ReactDOM.render(
  <Card style={{ width: 240 }} bodyStyle={{ padding: 0 }}>
    <div className="custom-image">
      <img alt="example" width="100%" src="https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png" />
    </div>
    <div className="custom-card">
      <h3>Europe Street beat</h3>
      <p>www.instagram.com</p>
    </div>
  </Card>
, mountNode);
.custom-image img {
  display: block;
}
.custom-card {
  padding: 10px 16px;
}
.custom-card p {
  color: #999;
}

Card title

Card content

Card title

Card content

Card title

Card content

Cards usually cooperate with grid layout in overview page.

import { Card, Col, Row } from 'antd';

ReactDOM.render(
  <div style={{ background: '#ECECEC', padding: '30px' }}>
    <Row>
      <Col span="8">
        <Card title="Card title" bordered={false}>Card content</Card>
      </Col>
      <Col span="8">
        <Card title="Card title" bordered={false}>Card content</Card>
      </Col>
      <Col span="8">
        <Card title="Card title" bordered={false}>Card content</Card>
      </Col>
    </Row>
  </div>
, mountNode);
/* Increase grid spacing of 16px  */
.code-box-demo .ant-row {
  margin-left: -8px;
  margin-right: -8px;
}
.code-box-demo .ant-row > div {
  padding: 0 8px;
}

Card title

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

import { Card } from 'antd';

ReactDOM.render(
  <Card loading title="Card title" style={{ width: '34%' }}>
    Whatever content
  </Card>
, mountNode);

API#

<Card title="Card title">Card content</Card>
PropertyDescriptionTypeDefault
titleCard titlestring|ReactNode-
extraContent to render in the top-right corner of the cardstring|ReactNode-
borderedToggles rendering of the border around the cardbooleantrue
bodyStyleInline style to apply to the card contentobject-
loadingShows a loading indicator while the contents of the card are being fetchedbooleanfalse