React Card Component

React card component provides a flexible and extensible container for displaying content. Card is delivered with a bunch of variants and options.

About#

A react card component is a content container. It incorporates options for images, headers, and footers, a wide variety of content, contextual background colors, and excellent display options.

Example#

Cards are built with as little markup and styles as possible but still manage to deliver a bunch of control and customization. Built with flexbox, they offer easy alignment and mix well with other CoreUI components. Cards have no top, left, and right margins by default, so use spacing utilities as needed. They have no fixed width to start, so they'll fill the full width of its parent.

Below is an example of a basic card with mixed content and a fixed width. Cards have no fixed width to start, so they'll naturally fill the full width of its parent element.

Card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Go somewhere
1<CCard style={{ width: '18rem' }}>
2 <CCardImage orientation="top" src="/images/react.jpg" />
3 <CCardBody>
4 <CCardTitle>Card title</CCardTitle>
5 <CCardText>
6 Some quick example text to build on the card title and make up the bulk of the card's content.
7 </CCardText>
8 <CButton href="#">Go somewhere</CButton>
9 </CCardBody>
10</CCard>

Content types#

CoreUI card supports a wide variety of content, including images, text, list groups, links, and more. Below are examples of those elements.

Body#

The main block of a card is the <CCardBody>. Use it whenever you need a padded section within a card.

This is some text within a card body.
1<CCard>
2 <CCardBody>This is some text within a card body.</CCardBody>
3</CCard>

Card titles are managed by <CCardTitle> component. Identically, links are attached and collected next to each other by <CCardLink> component.

Subtitles are managed by <CCardSubtitle> component. If the <CCardTitle> also, the <CCardSubtitle> items are stored in a <CCardBody> item, the card title, and subtitle are arranged rightly.

Card title
Card subtitle

Some quick example text to build on the card title and make up the bulk of the card's content.

Card linkAnother link
1<CCard style={{ width: '18rem' }}>
2 <CCardBody>
3 <CCardTitle>Card title</CCardTitle>
4 <CCardSubtitle className="mb-2 text-medium-emphasis">Card subtitle</CCardSubtitle>
5 <CCardText>
6 Some quick example text to build on the card title and make up the bulk of the card's content.
7 </CCardText>
8 <CCardLink href="#">Card link</CCardLink>
9 <CCardLink href="#">Another link</CCardLink>
10 </CCardBody>
11</CCard>

Images#

orientation="top" places a picture to the top of the card. With <CCardText>, text can be added to the card. Text within <CCardText> can additionally be styled with the regular HTML tags.

Some quick example text to build on the card title and make up the bulk of the card's content.

1<CCard style={{ width: '18rem' }}>
2 <CCardImage orientation="top" src="/images/react.jpg" />
3 <CCardBody>
4 <CCardText>
5 Some quick example text to build on the card title and make up the bulk of the card's content.
6 </CCardText>
7 </CCardBody>
8</CCard>

List groups#

Create lists of content in a card with a flush list group.

  • Cras justo odio
  • Dapibus ac facilisis in
  • Vestibulum at eros
1<CCard style={{ width: '18rem' }}>
2 <CListGroup flush>
3 <CListGroupItem>Cras justo odio</CListGroupItem>
4 <CListGroupItem>Dapibus ac facilisis in</CListGroupItem>
5 <CListGroupItem>Vestibulum at eros</CListGroupItem>
6 </CListGroup>
7</CCard>
Header
  • Cras justo odio
  • Dapibus ac facilisis in
  • Vestibulum at eros
1<CCard style={{ width: '18rem' }}>
2 <CCardHeader>Header</CCardHeader>
3 <CListGroup flush>
4 <CListGroupItem>Cras justo odio</CListGroupItem>
5 <CListGroupItem>Dapibus ac facilisis in</CListGroupItem>
6 <CListGroupItem>Vestibulum at eros</CListGroupItem>
7 </CListGroup>
8</CCard>
  • Cras justo odio
  • Dapibus ac facilisis in
  • Vestibulum at eros
1<CCard style={{ width: '18rem' }}>
2 <CListGroup flush>
3 <CListGroupItem>Cras justo odio</CListGroupItem>
4 <CListGroupItem>Dapibus ac facilisis in</CListGroupItem>
5 <CListGroupItem>Vestibulum at eros</CListGroupItem>
6 </CListGroup>
7 <CCardFooter>Footer</CCardFooter>
8</CCard>

Kitchen sink#

Combine and match many content types to build the card you need, or throw everything in there. Shown below are image styles, blocks, text styles, and a list group—all wrapped in a fixed-width card.

Card title

Some quick example text to build on the card title and make up the bulk of the card's content.

  • Cras justo odio
  • Dapibus ac facilisis in
  • Vestibulum at eros
1<CCard style={{ width: '18rem' }}>
2 <CCardImage orientation="top" src="/images/react.jpg" />
3 <CCardBody>
4 <CCardTitle>Card title</CCardTitle>
5 <CCardText>
6 Some quick example text to build on the card title and make up the bulk of the card's content.
7 </CCardText>
8 </CCardBody>
9 <CListGroup flush>
10 <CListGroupItem>Cras justo odio</CListGroupItem>
11 <CListGroupItem>Dapibus ac facilisis in</CListGroupItem>
12 <CListGroupItem>Vestibulum at eros</CListGroupItem>
13 </CListGroup>
14 <CCardBody>
15 <CCardLink href="#">Card link</CCardLink>
16 <CCardLink href="#">Another link</CCardLink>
17 </CCardBody>
18</CCard>

Add an optional header and/or footer within a card.

Header
Special title treatment

With supporting text below as a natural lead-in to additional content.

Go somewhere
1<CCard>
2 <CCardHeader>Header</CCardHeader>
3 <CCardBody>
4 <CCardTitle>Special title treatment</CCardTitle>
5 <CCardText>With supporting text below as a natural lead-in to additional content.</CCardText>
6 <CButton href="#">Go somewhere</CButton>
7 </CCardBody>
8</CCard>

Card headers can be styled by adding ex. component="h5".

Header
Special title treatment

With supporting text below as a natural lead-in to additional content.

Go somewhere
1<CCard>
2 <CCardHeader component="h5">Header</CCardHeader>
3 <CCardBody>
4 <CCardTitle>Special title treatment</CCardTitle>
5 <CCardText>With supporting text below as a natural lead-in to additional content.</CCardText>
6 <CButton href="#">Go somewhere</CButton>
7 </CCardBody>
8</CCard>
Quote

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

Someone famous in Source Title
1<CCard>
2 <CCardHeader>Quote</CCardHeader>
3 <CCardBody>
4 <blockquote className="blockquote mb-0">
5 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
6 <footer className="blockquote-footer">
7 Someone famous in <cite title="Source Title">Source Title</cite>
8 </footer>
9 </blockquote>
10 </CCardBody>
11</CCard>
Header
Special title treatment

With supporting text below as a natural lead-in to additional content.

Go somewhere
1<CCard className="text-center">
2 <CCardHeader>Header</CCardHeader>
3 <CCardBody>
4 <CCardTitle>Special title treatment</CCardTitle>
5 <CCardText>With supporting text below as a natural lead-in to additional content.</CCardText>
6 <CButton href="#">Go somewhere</CButton>
7 </CCardBody>
8 <CCardFooter className="text-medium-emphasis">2 days ago</CCardFooter>
9</CCard>

Sizing#

Cards assume no specific width to start, so they'll be 100% wide unless otherwise stated. You can adjust this as required with custom CSS, grid classes, grid Sass mixins, or services.

Using grid markup#

Using the grid, wrap cards in columns and rows as needed.

Special title treatment

With supporting text below as a natural lead-in to additional content.

Go somewhere
Special title treatment

With supporting text below as a natural lead-in to additional content.

Go somewhere
1<CRow>
2 <CCol sm={6}>
3 <CCard>
4 <CCardBody>
5 <CCardTitle>Special title treatment</CCardTitle>
6 <CCardText>
7 With supporting text below as a natural lead-in to additional content.
8 </CCardText>
9 <CButton href="#">Go somewhere</CButton>
10 </CCardBody>
11 </CCard>
12 </CCol>
13 <CCol sm={6}>
14 <CCard>
15 <CCardBody>
16 <CCardTitle>Special title treatment</CCardTitle>
17 <CCardText>
18 With supporting text below as a natural lead-in to additional content.
19 </CCardText>
20 <CButton href="#">Go somewhere</CButton>
21 </CCardBody>
22 </CCard>
23 </CCol>
24</CRow>

Using utilities#

Use some of available sizing utilities to rapidly set a card's width.

Card title

With supporting text below as a natural lead-in to additional content.

Go somewhere
Card title

With supporting text below as a natural lead-in to additional content.

Go somewhere
1<CCard className="w-75">
2 <CCardBody>
3 <CCardTitle>Card title</CCardTitle>
4 <CCardText>With supporting text below as a natural lead-in to additional content.</CCardText>
5 <CButton href="#">Go somewhere</CButton>
6 </CCardBody>
7 </CCard>
8 <CCard className="w-50">
9 <CCardBody>
10 <CCardTitle>Card title</CCardTitle>
11 <CCardText>With supporting text below as a natural lead-in to additional content.</CCardText>
12 <CButton href="#">Go somewhere</CButton>
13 </CCardBody>
14 </CCard>

Using custom CSS#

Use custom CSS in your stylesheets or as inline styles to set a width.

Special title treatment

With supporting text below as a natural lead-in to additional content.

Go somewhere
1<CCard style={{ width: '18rem' }}>
2 <CCardBody>
3 <CCardTitle>Special title treatment</CCardTitle>
4 <CCardText>With supporting text below as a natural lead-in to additional content.</CCardText>
5 <CButton href="#">Go somewhere</CButton>
6 </CCardBody>
7</CCard>

Text alignment#

You can instantly change the text arrangement of any card—in its whole or specific parts—with text align classes.

Special title treatment

With supporting text below as a natural lead-in to additional content.

Go somewhere
Special title treatment

With supporting text below as a natural lead-in to additional content.

Go somewhere
Special title treatment

With supporting text below as a natural lead-in to additional content.

Go somewhere
1<CCard style={{width: '18rem'}}>
2 <CCardBody>
3 <CCardTitle>Special title treatment</CCardTitle>
4 <CCardText>With supporting text below as a natural lead-in to additional content.</CCardText>
5 <CButton href="#">Go somewhere</CButton>
6 </CCardBody>
7 </CCard>
8 <CCard className="text-center" style={{width: '18rem'}}>
9 <CCardBody>
10 <CCardTitle>Special title treatment</CCardTitle>
11 <CCardText>With supporting text below as a natural lead-in to additional content.</CCardText>
12 <CButton href="#">Go somewhere</CButton>
13 </CCardBody>
14 </CCard>
15 <CCard className="text-end" style={{width: '18rem'}}>
16 <CCardBody>
17 <CCardTitle>Special title treatment</CCardTitle>
18 <CCardText>With supporting text below as a natural lead-in to additional content.</CCardText>
19 <CButton href="#">Go somewhere</CButton>
20 </CCardBody>
21 </CCard>

Add some navigation to a <CCardHeader> with our <CNav> component.

Special title treatment

With supporting text below as a natural lead-in to additional content.

Go somewhere
1<CCard className="text-center">
2 <CCardHeader>
3 <CNav variant="tabs" className="card-header-tabs">
4 <CNavItem>
5 <CNavLink href="#" active>
6 Active
7 </CNavLink>
8 </CNavItem>
9 <CNavItem>
10 <CNavLink href="#">Link</CNavLink>
11 </CNavItem>
12 <CNavItem>
13 <CNavLink href="#" disabled>
14 Disabled
15 </CNavLink>
16 </CNavItem>
17 </CNav>
18 </CCardHeader>
19 <CCardBody>
20 <CCardTitle>Special title treatment</CCardTitle>
21 <CCardText>With supporting text below as a natural lead-in to additional content.</CCardText>
22 <CButton href="#">Go somewhere</CButton>
23 </CCardBody>
24</CCard>
Special title treatment

With supporting text below as a natural lead-in to additional content.

Go somewhere
1<CCard className="text-center">
2 <CCardHeader>
3 <CNav variant="pills" className="card-header-pills">
4 <CNavItem>
5 <CNavLink href="#" active>
6 Active
7 </CNavLink>
8 </CNavItem>
9 <CNavItem>
10 <CNavLink href="#">Link</CNavLink>
11 </CNavItem>
12 <CNavItem>
13 <CNavLink href="#" disabled>
14 Disabled
15 </CNavLink>
16 </CNavItem>
17 </CNav>
18 </CCardHeader>
19 <CCardBody>
20 <CCardTitle>Special title treatment</CCardTitle>
21 <CCardText>With supporting text below as a natural lead-in to additional content.</CCardText>
22 <CButton href="#">Go somewhere</CButton>
23 </CCardBody>
24</CCard>

Images#

Cards introduce several options for acting with images. Pick from appending "image caps" at either end of a card, overlaying images with content, or just inserting the image in a card.

Image caps#

Similar to headers and footers, cards can include top and bottom "image caps"—images at the top or bottom of a card.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Last updated 3 mins ago

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Last updated 3 mins ago

1<CCard className="mb-3">
2 <CCardImage orientation="top" src="/images/react.jpg" />
3 <CCardBody>
4 <CCardTitle>Card title</CCardTitle>
5 <CCardText>This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</CCardText>
6 <CCardText><small className="text-medium-emphasis">Last updated 3 mins ago</small></CCardText>
7 </CCardBody>
8 </CCard>
9 <CCard className="mb-3">
10 <CCardBody>
11 <CCardTitle>Card title</CCardTitle>
12 <CCardText>This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</CCardText>
13 <CCardText><small className="text-medium-emphasis">Last updated 3 mins ago</small></CCardText>
14 </CCardBody>
15 <CCardImage orientation="bottom" src="/images/react.jpg" />
16 </CCard>

Image overlays#

Adapt an image into a background and overlay your text. Depending on the image, you may need additional styles or utilities.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Last updated 3 mins ago

1<CCard className="mb-3 bg-dark text-white">
2 <CCardImage src="/images/react.jpg" />
3 <CCardImageOverlay>
4 <CCardTitle>Card title</CCardTitle>
5 <CCardText>
6 This is a wider card with supporting text below as a natural lead-in to additional content.
7 This content is a little bit longer.
8 </CCardText>
9 <CCardText>Last updated 3 mins ago</CCardText>
10 </CCardImageOverlay>
11</CCard>

Horizontal#

Using a combination of grid and utility classes, cards can be made horizontal in a mobile-friendly and responsive way. In the example below, we remove the grid gutters with .g-0 and use .col-md-* classes to make the card horizontal at the md breakpoint. Further adjustments may be needed depending on your card content.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Last updated 3 mins ago

1<CCard className="mb-3" style={{ maxWidth: '540px' }}>
2 <CRow className="g-0">
3 <CCol md={4}>
4 <CCardImage src="/images/react400.jpg" />
5 </CCol>
6 <CCol md={8}>
7 <CCardBody>
8 <CCardTitle>Card title</CCardTitle>
9 <CCardText>
10 This is a wider card with supporting text below as a natural lead-in to additional
11 content. This content is a little bit longer.
12 </CCardText>
13 <CCardText>
14 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
15 </CCardText>
16 </CCardBody>
17 </CCol>
18 </CRow>
19</CCard>

Card styles#

Cards include various options for customizing their backgrounds, borders, and color.

Background and color#

Use color property to change the appearance of a card.

Header
primary card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
secondary card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
success card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
danger card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
warning card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
info card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
light card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
dark card title

Some quick example text to build on the card title and make up the bulk of the card's content.

1<>
2 {[
3 { color: 'primary', textColor: 'white' },
4 { color: 'secondary', textColor: 'white' },
5 { color: 'success', textColor: 'white' },
6 { color: 'danger', textColor: 'white' },
7 { color: 'warning' },
8 { color: 'info', textColor: 'white' },
9 { color: 'light' },
10 { color: 'dark', textColor: 'white' },
11 ].map((item, index) => (
12 <CCard
13 color={item.color}
14 textColor={item.textColor}
15 className="mb-3"
16 style={{ maxWidth: '18rem' }}
17 key={index}
18 >
19 <CCardHeader>Header</CCardHeader>
20 <CCardBody>
21 <CCardTitle>{item.color} card title</CCardTitle>
22 <CCardText>
23 Some quick example text to build on the card title and make up the bulk of the card's
24 content.
25 </CCardText>
26 </CCardBody>
27 </CCard>
28 ))}
29</>
Conveying meaning to assistive technologies

Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (e.g. the visible text), or is included through alternative means, such as additional text hidden with the `.visually-hidden` class.

Border#

Use border utilities to change just the border-color of a card. Note that you can set textColor property on the <CCard> or a subset of the card's contents as shown below.

Header
primary card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
secondary card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
success card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
danger card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
warning card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
info card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
light card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
dark card title

Some quick example text to build on the card title and make up the bulk of the card's content.

1<>
2 {[
3 { color: 'primary', textColor: 'primary' },
4 { color: 'secondary', textColor: 'secondary' },
5 { color: 'success', textColor: 'success' },
6 { color: 'danger', textColor: 'danger' },
7 { color: 'warning', textColor: 'warning' },
8 { color: 'info', textColor: 'info' },
9 { color: 'light' },
10 { color: 'dark' },
11 ].map((item, index) => (
12 <CCard
13 textColor={item.textColor}
14 className={`mb-3 border-${item.color}`}
15 style={{ maxWidth: '18rem' }}
16 key={index}
17 >
18 <CCardHeader>Header</CCardHeader>
19 <CCardBody>
20 <CCardTitle>{item.color} card title</CCardTitle>
21 <CCardText>
22 Some quick example text to build on the card title and make up the bulk of the card's
23 content.
24 </CCardText>
25 </CCardBody>
26 </CCard>
27 ))}
28</>

Top border#

Header
primary card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
secondary card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
success card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
danger card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
warning card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
info card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
light card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Header
dark card title

Some quick example text to build on the card title and make up the bulk of the card's content.

1<>
2 {[
3 { color: 'primary', textColor: 'primary' },
4 { color: 'secondary', textColor: 'secondary' },
5 { color: 'success', textColor: 'success' },
6 { color: 'danger', textColor: 'danger' },
7 { color: 'warning', textColor: 'warning' },
8 { color: 'info', textColor: 'info' },
9 { color: 'light' },
10 { color: 'dark' },
11 ].map((item, index) => (
12 <CCard
13 textColor={item.textColor}
14 className={`mb-3 border-top-${item.color} border-top-3`}
15 style={{ maxWidth: '18rem' }}
16 key={index}
17 >
18 <CCardHeader>Header</CCardHeader>
19 <CCardBody>
20 <CCardTitle>{item.color} card title</CCardTitle>
21 <CCardText>
22 Some quick example text to build on the card title and make up the bulk of the card's
23 content.
24 </CCardText>
25 </CCardBody>
26 </CCard>
27 ))}
28</>

Card layout#

In addition to styling the content within cards, CoreUI includes a few options for laying out series of cards. For the time being, these layout options are not yet responsive.

Card groups#

Use card groups to render cards as a single, attached element with equal width and height columns. Card groups start off stacked and use display: flex; to become attached with uniform dimensions starting at the sm breakpoint.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Last updated 3 mins ago

Card title

This card has supporting text below as a natural lead-in to additional content.

Last updated 3 mins ago

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.

Last updated 3 mins ago

1<CCardGroup>
2 <CCard>
3 <CCardImage orientation="top" src="/images/react.jpg" />
4 <CCardBody>
5 <CCardTitle>Card title</CCardTitle>
6 <CCardText>
7 This is a wider card with supporting text below as a natural lead-in to additional content.
8 This content is a little bit longer.
9 </CCardText>
10 <CCardText>
11 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
12 </CCardText>
13 </CCardBody>
14 </CCard>
15 <CCard>
16 <CCardImage orientation="top" src="/images/react.jpg" />
17 <CCardBody>
18 <CCardTitle>Card title</CCardTitle>
19 <CCardText>
20 This card has supporting text below as a natural lead-in to additional content.
21 </CCardText>
22 <CCardText>
23 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
24 </CCardText>
25 </CCardBody>
26 </CCard>
27 <CCard>
28 <CCardImage orientation="top" src="/images/react.jpg" />
29 <CCardBody>
30 <CCardTitle>Card title</CCardTitle>
31 <CCardText>
32 This is a wider card with supporting text below as a natural lead-in to additional content.
33 This card has even longer content than the first to show that equal height action.
34 </CCardText>
35 <CCardText>
36 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
37 </CCardText>
38 </CCardBody>
39 </CCard>
40</CCardGroup>

When using card groups with footers, their content will automatically line up.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Card title

This card has supporting text below as a natural lead-in to additional content.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.

1<CCardGroup>
2 <CCard>
3 <CCardImage orientation="top" src="/images/react.jpg" />
4 <CCardBody>
5 <CCardTitle>Card title</CCardTitle>
6 <CCardText>
7 This is a wider card with supporting text below as a natural lead-in to additional content.
8 This content is a little bit longer.
9 </CCardText>
10 </CCardBody>
11 <CCardFooter>
12 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
13 </CCardFooter>
14 </CCard>
15 <CCard>
16 <CCardImage orientation="top" src="/images/react.jpg" />
17 <CCardBody>
18 <CCardTitle>Card title</CCardTitle>
19 <CCardText>
20 This card has supporting text below as a natural lead-in to additional content.
21 </CCardText>
22 </CCardBody>
23 <CCardFooter>
24 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
25 </CCardFooter>
26 </CCard>
27 <CCard>
28 <CCardImage orientation="top" src="/images/react.jpg" />
29 <CCardBody>
30 <CCardTitle>Card title</CCardTitle>
31 <CCardText>
32 This is a wider card with supporting text below as a natural lead-in to additional content.
33 This card has even longer content than the first to show that equal height action.
34 </CCardText>
35 </CCardBody>
36 <CCardFooter>
37 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
38 </CCardFooter>
39 </CCard>
40</CCardGroup>

Grid cards#

Use the CRow component and set xs|sm|md|lg|xl|xxl}={{ cols: * }} property to control how many grid columns (wrapped around your cards) you show per row. For example, here's xs={{cols: 1}} laying out the cards on one column, and md={{cols: 1}} splitting four cards to equal width across multiple rows, from the medium breakpoint up.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

1<CRow xs={{ cols: 1, gutter: 4 }} md={{ cols: 2 }}>
2 <CCol xs>
3 <CCard>
4 <CCardImage orientation="top" src="/images/react.jpg" />
5 <CCardBody>
6 <CCardTitle>Card title</CCardTitle>
7 <CCardText>
8 This is a wider card with supporting text below as a natural lead-in to additional
9 content. This content is a little bit longer.
10 </CCardText>
11 </CCardBody>
12 <CCardFooter>
13 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
14 </CCardFooter>
15 </CCard>
16 </CCol>
17 <CCol xs>
18 <CCard>
19 <CCardImage orientation="top" src="/images/react.jpg" />
20 <CCardBody>
21 <CCardTitle>Card title</CCardTitle>
22 <CCardText>
23 This is a wider card with supporting text below as a natural lead-in to additional
24 content. This content is a little bit longer.
25 </CCardText>
26 </CCardBody>
27 <CCardFooter>
28 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
29 </CCardFooter>
30 </CCard>
31 </CCol>
32 <CCol xs>
33 <CCard>
34 <CCardImage orientation="top" src="/images/react.jpg" />
35 <CCardBody>
36 <CCardTitle>Card title</CCardTitle>
37 <CCardText>
38 This is a wider card with supporting text below as a natural lead-in to additional
39 content. This content is a little bit longer.
40 </CCardText>
41 </CCardBody>
42 <CCardFooter>
43 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
44 </CCardFooter>
45 </CCard>
46 </CCol>
47 <CCol xs>
48 <CCard>
49 <CCardImage orientation="top" src="/images/react.jpg" />
50 <CCardBody>
51 <CCardTitle>Card title</CCardTitle>
52 <CCardText>
53 This is a wider card with supporting text below as a natural lead-in to additional
54 content. This content is a little bit longer.
55 </CCardText>
56 </CCardBody>
57 <CCardFooter>
58 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
59 </CCardFooter>
60 </CCard>
61 </CCol>
62</CRow>

Change it to md={{ cols: 3}} and you'll see the fourth card wrap.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

1<CRow xs={{ cols: 1, gutter: 4 }} md={{ cols: 3 }}>
2 <CCol xs>
3 <CCard>
4 <CCardImage orientation="top" src="/images/react.jpg" />
5 <CCardBody>
6 <CCardTitle>Card title</CCardTitle>
7 <CCardText>
8 This is a wider card with supporting text below as a natural lead-in to additional
9 content. This content is a little bit longer.
10 </CCardText>
11 </CCardBody>
12 <CCardFooter>
13 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
14 </CCardFooter>
15 </CCard>
16 </CCol>
17 <CCol xs>
18 <CCard>
19 <CCardImage orientation="top" src="/images/react.jpg" />
20 <CCardBody>
21 <CCardTitle>Card title</CCardTitle>
22 <CCardText>
23 This is a wider card with supporting text below as a natural lead-in to additional
24 content. This content is a little bit longer.
25 </CCardText>
26 </CCardBody>
27 <CCardFooter>
28 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
29 </CCardFooter>
30 </CCard>
31 </CCol>
32 <CCol xs>
33 <CCard>
34 <CCardImage orientation="top" src="/images/react.jpg" />
35 <CCardBody>
36 <CCardTitle>Card title</CCardTitle>
37 <CCardText>
38 This is a wider card with supporting text below as a natural lead-in to additional
39 content. This content is a little bit longer.
40 </CCardText>
41 </CCardBody>
42 <CCardFooter>
43 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
44 </CCardFooter>
45 </CCard>
46 </CCol>
47 <CCol xs>
48 <CCard>
49 <CCardImage orientation="top" src="/images/react.jpg" />
50 <CCardBody>
51 <CCardTitle>Card title</CCardTitle>
52 <CCardText>
53 This is a wider card with supporting text below as a natural lead-in to additional
54 content. This content is a little bit longer.
55 </CCardText>
56 </CCardBody>
57 <CCardFooter>
58 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
59 </CCardFooter>
60 </CCard>
61 </CCol>
62</CRow>

When you need equal height, add .h-100 to the cards. If you want equal heights by default, you can set $card-height: 100% in Sass.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Card title

This card has supporting text below as a natural lead-in to additional content.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

1<CRow xs={{ cols: 1 }} md={{ cols: 3 }} className="g-4">
2 <CCol xs>
3 <CCard className="h-100">
4 <CCardImage orientation="top" src="/images/react.jpg" />
5 <CCardBody>
6 <CCardTitle>Card title</CCardTitle>
7 <CCardText>
8 This is a wider card with supporting text below as a natural lead-in to additional
9 content. This content is a little bit longer.
10 </CCardText>
11 </CCardBody>
12 </CCard>
13 </CCol>
14 <CCol xs>
15 <CCard className="h-100">
16 <CCardImage orientation="top" src="/images/react.jpg" />
17 <CCardBody>
18 <CCardTitle>Card title</CCardTitle>
19 <CCardText>
20 This card has supporting text below as a natural lead-in to additional content.
21 </CCardText>
22 </CCardBody>
23 </CCard>
24 </CCol>
25 <CCol xs>
26 <CCard className="h-100">
27 <CCardImage orientation="top" src="/images/react.jpg" />
28 <CCardBody>
29 <CCardTitle>Card title</CCardTitle>
30 <CCardText>
31 This is a wider card with supporting text below as a natural lead-in to additional
32 content. This card has even longer content than the first to show that equal height
33 action.
34 </CCardText>
35 </CCardBody>
36 </CCard>
37 </CCol>
38 <CCol xs>
39 <CCard className="h-100">
40 <CCardImage orientation="top" src="/images/react.jpg" />
41 <CCardBody>
42 <CCardTitle>Card title</CCardTitle>
43 <CCardText>
44 This is a wider card with supporting text below as a natural lead-in to additional
45 content. This content is a little bit longer.
46 </CCardText>
47 </CCardBody>
48 </CCard>
49 </CCol>
50</CRow>

Just like with card groups, card footers will automatically line up.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Card title

This card has supporting text below as a natural lead-in to additional content.

Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.

1<CRow xs={{ cols: 1 }} md={{ cols: 3 }} className="g-4">
2 <CCol xs>
3 <CCard className="h-100">
4 <CCardImage orientation="top" src="/images/react.jpg" />
5 <CCardBody>
6 <CCardTitle>Card title</CCardTitle>
7 <CCardText>
8 This is a wider card with supporting text below as a natural lead-in to additional
9 content. This content is a little bit longer.
10 </CCardText>
11 </CCardBody>
12 <CCardFooter>
13 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
14 </CCardFooter>
15 </CCard>
16 </CCol>
17 <CCol xs>
18 <CCard className="h-100">
19 <CCardImage orientation="top" src="/images/react.jpg" />
20 <CCardBody>
21 <CCardTitle>Card title</CCardTitle>
22 <CCardText>
23 This card has supporting text below as a natural lead-in to additional content.
24 </CCardText>
25 </CCardBody>
26 <CCardFooter>
27 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
28 </CCardFooter>
29 </CCard>
30 </CCol>
31 <CCol xs>
32 <CCard className="h-100">
33 <CCardImage orientation="top" src="/images/react.jpg" />
34 <CCardBody>
35 <CCardTitle>Card title</CCardTitle>
36 <CCardText>
37 This is a wider card with supporting text below as a natural lead-in to additional
38 content. This card has even longer content than the first to show that equal height
39 action.
40 </CCardText>
41 </CCardBody>
42 <CCardFooter>
43 <small className="text-medium-emphasis">Last updated 3 mins ago</small>
44 </CCardFooter>
45 </CCard>
46 </CCol>
47</CRow>

API#

CCard#

1import { CCard } from '@coreui/react'
2// or
3import CCard from '@coreui/react/src/components/card/CCard'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the base component.string-
colorSets the color context of the component to one of CoreUI’s themed colors.{'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'primary-gradient' | 'secondary-gradient' | 'success-gradient' | 'danger-gradient' | 'warning-gradient' | 'info-gradient' | 'dark-gradient' | 'light-gradient' | string }-
textColorSets the text color context of the component to one of CoreUI’s themed colors.'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'white' | 'muted' | 'high-emphasis' | 'medium-emphasis' | 'disabled' | 'high-emphasis-inverse' | 'medium-emphasis-inverse' | 'disabled-inverse' | string-

CCardBody#

1import { CCardBody } from '@coreui/react'
2// or
3import CCardBody from '@coreui/react/src/components/card/CCardBody'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the base component.string-

CCardFooter#

1import { CCardFooter } from '@coreui/react'
2// or
3import CCardFooter from '@coreui/react/src/components/card/CCardFooter'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the base component.string-

CCardGroup#

1import { CCardGroup } from '@coreui/react'
2// or
3import CCardGroup from '@coreui/react/src/components/card/CCardGroup'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the base component.string-

CCardHeader#

1import { CCardHeader } from '@coreui/react'
2// or
3import CCardHeader from '@coreui/react/src/components/card/CCardHeader'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the base component.string-
componentComponent used for the root node. Either a string to use a HTML element or a component.string | ComponentClass<any, any> | FunctionComponent<any>-

CCardImage#

1import { CCardImage } from '@coreui/react'
2// or
3import CCardImage from '@coreui/react/src/components/card/CCardImage'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the base component.string-
componentComponent used for the root node. Either a string to use a HTML element or a component.string | ComponentClass<any, any> | FunctionComponent<any>-
orientationOptionally orientate the image to the top, bottom, or make it overlaid across the card.'top' | 'bottom'-

CCardImageOverlay#

1import { CCardImageOverlay } from '@coreui/react'
2// or
3import CCardImageOverlay from '@coreui/react/src/components/card/CCardImageOverlay'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the base component.string-
1import { CCardLink } from '@coreui/react'
2// or
3import CCardLink from '@coreui/react/src/components/card/CCardLink'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the base component.string-
hrefThe href attribute specifies the URL of the page the link goes to.string-

CCardSubtitle#

1import { CCardSubtitle } from '@coreui/react'
2// or
3import CCardSubtitle from '@coreui/react/src/components/card/CCardSubtitle'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the component.string-
componentComponent used for the root node. Either a string to use a HTML element or a component.string | ComponentClass<any, any> | FunctionComponent<any>-

CCardText#

1import { CCardText } from '@coreui/react'
2// or
3import CCardText from '@coreui/react/src/components/card/CCardText'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the component.string-
componentComponent used for the root node. Either a string to use a HTML element or a component.string | ComponentClass<any, any> | FunctionComponent<any>-

CCardTitle#

1import { CCardTitle } from '@coreui/react'
2// or
3import CCardTitle from '@coreui/react/src/components/card/CCardTitle'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the component.string-
componentComponent used for the root node. Either a string to use a HTML element or a component.string | ComponentClass<any, any> | FunctionComponent<any>-