Cards
Bootstrap’s cards provide a flexible and extensible content container with multiple variants and options.
Basic Example
Content types
Body
Use <Card.Body>
to pad content inside a <Card>
.
Alternatively, you can use this shorthand version for Cards with body only, and no other children
Title, text, and links
Using <Card.Title>
, <Card.Subtitle>
, and
<Card.Text>
inside the <Card.Body>
will line them up nicely.
<Card.Link>
s are used to line up links next to each other.
<Card.Text>
outputs <p>
tags around the content, so you can
use multiple <Card.Text>
s to create separate paragraphs.
List Groups
Create lists of content in a card with a flush list group.
Kitchen Sink
Header and Footer
You may add a header by adding a <Card.Header>
component.
A <CardHeader>
can be styled by passing a heading element
through the <as>
prop
Images
Cards include a few options for working with images. Choose from appending “image caps” at either end of a card, overlaying images with card content, or simply embedding 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.
Image Overlays
Turn an image into a card background and overlay your card’s text. Depending on the image, you may or may not need additional styles or utilities.
Navigation
Add some navigation to a card’s header (or block) with React Bootstrap’s Nav components.
Card Styles
Background Color
You can change a card's appearance by changing their <bg>
, and <text>
props.
Border Color
Card layout
Card Groups
Grid cards
Use Row
's grid column props to control how many cards to show per row.
API
Cardview source file
import Card from 'react-bootstrap/Card'
Copy import code for the Card componentName | Type | Default | Description |
---|---|---|---|
as | elementType | <div> | You can use a custom element type for this component. |
bg | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | Sets card background | |
body | boolean | false | When this prop is set, it creates a Card with a Card.Body inside passing the children directly to it |
border | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | Sets card border color | |
text | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'white' | 'muted' | Sets card text color | |
bsPrefix | string | 'card' | Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized bootstrap css. |
Card.Bodyview source file
import Card from 'react-bootstrap/Card'
Copy import code for the Card componentName | Type | Default | Description |
---|---|---|---|
as | elementType | <div> | You can use a custom element type for this component. |
bsPrefix required | string | 'card-body' | Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized bootstrap css. |
Card.Footerview source file
import Card from 'react-bootstrap/Card'
Copy import code for the Card componentName | Type | Default | Description |
---|---|---|---|
as | elementType | <div> | You can use a custom element type for this component. |
bsPrefix required | string | 'card-footer' | Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized bootstrap css. |
Card.Headerview source file
import Card from 'react-bootstrap/Card'
Copy import code for the Card componentName | Type | Default | Description |
---|---|---|---|
as | elementType | <div> | You can use a custom element type for this component. |
bsPrefix | string | 'card-header' | Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized bootstrap css. |
Card.Imgview source file
import Card from 'react-bootstrap/Card'
Copy import code for the Card componentName | Type | Default | Description |
---|---|---|---|
as | elementType | <img> | You can use a custom element type for this component. |
variant | 'top' | 'bottom' | Defines image position inside the card. | |
bsPrefix | string | 'card-img' | Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized bootstrap css. |
Card.ImgOverlayview source file
import Card from 'react-bootstrap/Card'
Copy import code for the Card componentName | Type | Default | Description |
---|---|---|---|
as | elementType | <div> | You can use a custom element type for this component. |
bsPrefix required | string | 'card-img-overlay' | Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized bootstrap css. |
Card.Linkview source file
import Card from 'react-bootstrap/Card'
Copy import code for the Card componentName | Type | Default | Description |
---|---|---|---|
as | elementType | <a> | You can use a custom element type for this component. |
bsPrefix required | string | 'card-link' | Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized bootstrap css. |
Card.Subtitleview source file
import Card from 'react-bootstrap/Card'
Copy import code for the Card componentName | Type | Default | Description |
---|---|---|---|
as | elementType | <DivStyledAsH6> | You can use a custom element type for this component. |
bsPrefix required | string | 'card-subtitle' | Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized bootstrap css. |
Card.Textview source file
import Card from 'react-bootstrap/Card'
Copy import code for the Card componentName | Type | Default | Description |
---|---|---|---|
as | elementType | <p> | You can use a custom element type for this component. |
bsPrefix required | string | 'card-text' | Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized bootstrap css. |
Card.Titleview source file
import Card from 'react-bootstrap/Card'
Copy import code for the Card componentName | Type | Default | Description |
---|---|---|---|
as | elementType | <DivStyledAsH5> | You can use a custom element type for this component. |
bsPrefix required | string | 'card-title' | Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized bootstrap css. |
CardGroupview source file
import CardGroup from 'react-bootstrap/CardGroup'
Copy import code for the CardGroup componentName | Type | Default | Description |
---|---|---|---|
as | elementType | <div> | You can use a custom element type for this component. |
bsPrefix required | string | 'card-group' | Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized bootstrap css. |