CoreUI is an MIT-licensed open source project and is completely free to use. However, the amount of effort needed to maintain and develop new features for the project is not sustainable without proper financial backing.
You can support our Open Source software development in the following ways:
React card component provides a flexible and extensible container for displaying content. Card is delivered with a bunch of variants and options.
CoreUI components are available as native Angular, Bootstrap (Vanilla JS), and Vue components. To learn more please visit the following pages.
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.
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.
Some quick example text to build on the card title and make up the bulk of the card's content.
Go somewhere1<CCard style={{ width: '18rem' }}>2 <CCardImage orientation="top" src={ReactImg} />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>
CoreUI card supports a wide variety of content, including images, text, list groups, links, and more. Below are examples of those elements.
The main block of a card is the <CCardBody>
. Use it whenever you need a padded section within a card.
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.
Some quick example text to build on the card title and make up the bulk of the card's content.
Card link Another link1<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>
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={ReactImg} />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>
Create lists of content in a card with a flush list group.
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>
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>
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>
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.
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={ReactImg} />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.
With supporting text below as a natural lead-in to additional content.
Go somewhere1<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"
.
With supporting text below as a natural lead-in to additional content.
Go somewhere1<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>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
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>
With supporting text below as a natural lead-in to additional content.
Go somewhere1<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>
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 the grid, wrap cards in columns and rows as needed.
With supporting text below as a natural lead-in to additional content.
Go somewhereWith supporting text below as a natural lead-in to additional content.
Go somewhere1<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>
Use some of available sizing utilities to rapidly set a card's width.
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>
Use custom CSS in your stylesheets or as inline styles to set a width.
With supporting text below as a natural lead-in to additional content.
Go somewhere1<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>
You can instantly change the text arrangement of any card—in its whole or specific parts—with text align classes.
With supporting text below as a natural lead-in to additional content.
Go somewhereWith supporting text below as a natural lead-in to additional content.
Go somewhereWith supporting text below as a natural lead-in to additional content.
Go somewhere1<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.
With supporting text below as a natural lead-in to additional content.
Go somewhere1<CCard className="text-center">2 <CCardHeader>3 <CNav variant="tabs" className="card-header-tabs">4 <CNavItem>5 <CNavLink href="#" active>Active</CNavLink>6 </CNavItem>7 <CNavItem>8 <CNavLink href="#">Link</CNavLink>9 </CNavItem>10 <CNavItem>11 <CNavLink href="#" disabled>Disabled</CNavLink>12 </CNavItem>13 </CNav>14 </CCardHeader>15 <CCardBody>16 <CCardTitle>Special title treatment</CCardTitle>17 <CCardText>With supporting text below as a natural lead-in to additional content.</CCardText>18 <CButton href="#">Go somewhere</CButton>19 </CCardBody>20</CCard>
With supporting text below as a natural lead-in to additional content.
Go somewhere1<CCard className="text-center">2 <CCardHeader>3 <CNav variant="pills" className="card-header-pills">4 <CNavItem>5 <CNavLink href="#" active>Active</CNavLink>6 </CNavItem>7 <CNavItem>8 <CNavLink href="#">Link</CNavLink>9 </CNavItem>10 <CNavItem>11 <CNavLink href="#" disabled>Disabled</CNavLink>12 </CNavItem>13 </CNav>14 </CCardHeader>15 <CCardBody>16 <CCardTitle>Special title treatment</CCardTitle>17 <CCardText>With supporting text below as a natural lead-in to additional content.</CCardText>18 <CButton href="#">Go somewhere</CButton>19 </CCardBody>20</CCard>
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.
Similar to headers and footers, cards can include top and bottom "image caps"—images at the top or bottom of a card.
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
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={ReactImg} />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={ReactImg} />16</CCard>
Adapt an image into a background and overlay your text. Depending on the image, you may need additional styles or utilities.
1<CCard className="mb-3 bg-dark text-white">2 <CCardImage src={ReactImg} />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>
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.
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={React400Img} />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 additional11 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>
Cards include various options for customizing their backgrounds, borders, and color.
Use color
property to change the appearance of a card.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
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 <CCard13 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's24 content.25 </CCardText>26 </CCardBody>27 </CCard>28 ))}29</>
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.
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.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
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 <CCard13 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's23 content.24 </CCardText>25 </CCardBody>26 </CCard>27 ))}28</>
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
Some quick example text to build on the card title and make up the bulk of the card's content.
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 <CCard13 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's23 content.24 </CCardText>25 </CCardBody>26 </CCard>27 ))}28</>
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.
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.
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
This card has supporting text below as a natural lead-in to additional content.
Last updated 3 mins ago
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={ReactImg} />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={ReactImg} />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={ReactImg} />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.
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
This card has supporting text below as a natural lead-in to additional content.
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={ReactImg} />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={ReactImg} />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={ReactImg} />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>
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.
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
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={ReactImg} />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 additional9 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={ReactImg} />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 additional24 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={ReactImg} />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 additional39 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={ReactImg} />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 additional54 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.
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
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={ReactImg} />5 <CCardBody>6 <CCardTitle>Card title</CCardTitle>7 <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>8 </CCardBody>9 <CCardFooter>10 <small className="text-medium-emphasis">Last updated 3 mins ago</small>11 </CCardFooter>12 </CCard>13 </CCol>14 <CCol xs>15 <CCard>16 <CCardImage orientation="top" src={ReactImg} />17 <CCardBody>18 <CCardTitle>Card title</CCardTitle>19 <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>20 </CCardBody>21 <CCardFooter>22 <small className="text-medium-emphasis">Last updated 3 mins ago</small>23 </CCardFooter>24 </CCard>25 </CCol>26 <CCol xs>27 <CCard>28 <CCardImage orientation="top" src={ReactImg} />29 <CCardBody>30 <CCardTitle>Card title</CCardTitle>31 <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>32 </CCardBody>33 <CCardFooter>34 <small className="text-medium-emphasis">Last updated 3 mins ago</small>35 </CCardFooter>36 </CCard>37 </CCol>38 <CCol xs>39 <CCard>40 <CCardImage orientation="top" src={ReactImg} />41 <CCardBody>42 <CCardTitle>Card title</CCardTitle>43 <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>44 </CCardBody>45 <CCardFooter>46 <small className="text-medium-emphasis">Last updated 3 mins ago</small>47 </CCardFooter>48 </CCard>49 </CCol>50</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.
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
This card has supporting text below as a natural lead-in to additional content.
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.
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={ReactImg} />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 additional9 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={ReactImg} />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={ReactImg} />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 additional32 content. This card has even longer content than the first to show that equal height33 action.34 </CCardText>35 </CCardBody>36 </CCard>37 </CCol>38 <CCol xs>39 <CCard className="h-100">40 <CCardImage orientation="top" src={ReactImg} />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 additional45 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.
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
This card has supporting text below as a natural lead-in to additional content.
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={ReactImg} />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 additional9 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={ReactImg} />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={ReactImg} />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 additional38 content. This card has even longer content than the first to show that equal height39 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>
React cards use local CSS variables on .card
for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too.
1--cui-card-spacer-y: #{$card-spacer-y};2--cui-card-spacer-x: #{$card-spacer-x};3--cui-card-title-spacer-y: #{$card-title-spacer-y};4--cui-card-border-width: #{$card-border-width};5--cui-card-border-color: #{$card-border-color};6--cui-card-border-radius: #{$card-border-radius};7--cui-card-box-shadow: #{$card-box-shadow};8--cui-card-inner-border-radius: #{$card-inner-border-radius};9--cui-card-cap-padding-y: #{$card-cap-padding-y};10--cui-card-cap-padding-x: #{$card-cap-padding-x};11--cui-card-cap-bg: #{$card-cap-bg};12--cui-card-cap-color: #{$card-cap-color};13--cui-card-height: #{$card-height};14--cui-card-color: #{$card-color};15--cui-card-bg: #{$card-bg};16--cui-card-img-overlay-padding: #{$card-img-overlay-padding};17--cui-card-group-margin: #{$card-group-margin};
1const vars = {2 '--my-css-var': 10,3 '--my-another-css-var': "red"4}5return <CCard style={vars}>...</CCard>
1$card-spacer-y: $spacer;2$card-spacer-x: $spacer;3$card-title-spacer-y: $spacer * .5;4$card-border-width: $border-width;5$card-border-color: var(--cui-border-color-translucent);6$card-border-radius: $border-radius;7$card-box-shadow: null;8$card-inner-border-radius: subtract($card-border-radius, $card-border-width);9$card-cap-padding-y: $card-spacer-y * .5;10$card-cap-padding-x: $card-spacer-x;11$card-cap-bg: rgba($black, .03);12$card-cap-color: unset;13$card-height: null;14$card-color: unset;15$card-bg: $white;16$card-img-overlay-padding: $spacer;17$card-group-margin: $grid-gutter-width * .5;
1import { CCard } from '@coreui/react'2// or3import CCard from '@coreui/react/src/components/card/CCard'
Property | Description | Type | Default |
---|---|---|---|
className | A string of all className you want applied to the base component. | string | - |
color | Sets 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 } | - |
textColor | Sets 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 | - |
1import { CCardBody } from '@coreui/react'2// or3import CCardBody from '@coreui/react/src/components/card/CCardBody'
Property | Description | Type | Default |
---|---|---|---|
className | A string of all className you want applied to the base component. | string | - |
1import { CCardFooter } from '@coreui/react'2// or3import CCardFooter from '@coreui/react/src/components/card/CCardFooter'
Property | Description | Type | Default |
---|---|---|---|
className | A string of all className you want applied to the base component. | string | - |
1import { CCardGroup } from '@coreui/react'2// or3import CCardGroup from '@coreui/react/src/components/card/CCardGroup'
Property | Description | Type | Default |
---|---|---|---|
className | A string of all className you want applied to the base component. | string | - |
1import { CCardHeader } from '@coreui/react'2// or3import CCardHeader from '@coreui/react/src/components/card/CCardHeader'
Property | Description | Type | Default |
---|---|---|---|
className | A string of all className you want applied to the base component. | string | - |
component | Component used for the root node. Either a string to use a HTML element or a component. | string | ComponentClass<any, any> | FunctionComponent<any> | - |
1import { CCardImage } from '@coreui/react'2// or3import CCardImage from '@coreui/react/src/components/card/CCardImage'
Property | Description | Type | Default |
---|---|---|---|
className | A string of all className you want applied to the base component. | string | - |
component | Component used for the root node. Either a string to use a HTML element or a component. | string | ComponentClass<any, any> | FunctionComponent<any> | - |
orientation | Optionally orientate the image to the top, bottom, or make it overlaid across the card. | 'top' | 'bottom' | - |
1import { CCardImageOverlay } from '@coreui/react'2// or3import CCardImageOverlay from '@coreui/react/src/components/card/CCardImageOverlay'
Property | Description | Type | Default |
---|---|---|---|
className | A string of all className you want applied to the base component. | string | - |
1import { CCardLink } from '@coreui/react'2// or3import CCardLink from '@coreui/react/src/components/card/CCardLink'
Property | Description | Type | Default |
---|---|---|---|
className | A string of all className you want applied to the base component. | string | - |
href | The href attribute specifies the URL of the page the link goes to. | string | - |
1import { CCardSubtitle } from '@coreui/react'2// or3import CCardSubtitle from '@coreui/react/src/components/card/CCardSubtitle'
Property | Description | Type | Default |
---|---|---|---|
className | A string of all className you want applied to the component. | string | - |
component | Component used for the root node. Either a string to use a HTML element or a component. | string | ComponentClass<any, any> | FunctionComponent<any> | - |
1import { CCardText } from '@coreui/react'2// or3import CCardText from '@coreui/react/src/components/card/CCardText'
Property | Description | Type | Default |
---|---|---|---|
className | A string of all className you want applied to the component. | string | - |
component | Component used for the root node. Either a string to use a HTML element or a component. | string | ComponentClass<any, any> | FunctionComponent<any> | - |
1import { CCardTitle } from '@coreui/react'2// or3import CCardTitle from '@coreui/react/src/components/card/CCardTitle'
Property | Description | Type | Default |
---|---|---|---|
className | A string of all className you want applied to the component. | string | - |
component | Component used for the root node. Either a string to use a HTML element or a component. | string | ComponentClass<any, any> | FunctionComponent<any> | - |