Basic examples
Simple
Use the following simple card component with a title and description.
Card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Image
You can use the following example of a card element with an image for blog posts, user cards, and many more.
Image with ripple
Indicate the point of touch with user input to screen reactions using ripple on card image.
Header and footer
Add optional header and footer sections to the card.
Special title treatment
With supporting text below as a natural lead-in to additional content.
Content types
Cards support a wide variety of content, including images, text, list groups, links, and more. Below are examples of what’s supported.
Body
The building block of a card is the div
with
p-6
class. Use it whenever you need a padded section within a
card.
This is some text within a card body.
Titles, text and links
Tailwind CSS classes beautifully style card titles, text, and links, creating a captivating and user-friendly experience.
Special title treatment
Card subtitle
Some quick example text to build on the card title and make up the bulk of the card's content.
Card Link Another LinkImages
The following example illustrates the card using Tailwind CSS classes, resulting in image being positioned at the top of each card.
Some quick example text to build on the card title and make up the bulk of the card's content.
List groups
Create lists of content in a card with a flush list group.
- Cras justo odio
- Dapibus ac facilisis in
- Vestibulum at eros
- Cras justo odio
- Dapibus ac facilisis in
- Vestibulum at eros
- Cras justo odio
- Dapibus ac facilisis in
- Vestibulum at eros
Kitchen sink
Mix and match multiple content types to create the card you need, or throw everything in there.
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
Header and footer
Add an optional header and/or footer within a card.
Special title treatment
With supporting text below as a natural lead-in to additional content.
An example that demonstrates a well-designed card header.
Featured
Special title treatment
With supporting text below as a natural lead-in to additional content.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Special title treatment
With supporting text below as a natural lead-in to additional content.
Sizing
Cards assume no specific width to start, so they’ll be 100% wide unless
otherwise stated. You can change this as needed with Tailwind CSS classes
like w-*
or max-w-*
.
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.
Special title treatment
With supporting text below as a natural lead-in to additional content.
Using utilities
Use handful of available tailwind sizing utilities to quickly set a card’s width.
Card title
With supporting text below as a natural lead-in to additional content.
Card title
With supporting text below as a natural lead-in to additional content.
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.
Text alignment
You can quickly change the text alignment of any card using dedicated
Tailwind CSS classes (text-left, text-center, text-right
).
Special title treatment
With supporting text below as a natural lead-in to additional content.
Special title treatment
With supporting text below as a natural lead-in to additional content.
Special title treatment
With supporting text below as a natural lead-in to additional content.
Navigation
Add some navigation to a card’s header (or block) with Tailiwnd Elements pills or tabs components.
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.
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
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.
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
Horizontal
Use card which has its child elements aligned horizontally.
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 styles
Cards include various options for customizing their backgrounds, borders, and color.
Background and color
Use bg-*
and text-*
classes to change the
appearance of a card.
Primary card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Secondary card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Success card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Danger card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Warning card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Info card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Light card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Dark card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Border
Modify the border color of a card by utilizing the
border-*
classes. Additionally, you can add
text-*
classes to achieve a design to the one demonstrated
below.
Primary card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Secondary card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Success card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Danger card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Warning card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Info card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Light card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Dark card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Mixins utilities
You can also change the borders on the card header and footer as needed,
and even remove their background-color
with
.bg-transparent
.
Success card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Card deck layout
In addition to styling the content within cards, Bootstrap includes a few options for laying out series of cards. For the time being, these layout options are not yet responsive.
Cards group
Use card groups to render cards as a single, attached element with equal
width and height columns. Card groups start off stacked and use class
flex
to become attached with uniform dimensions starting at
the sm breakpoint.
When using card groups with footers, their content will automatically line
up after adding mt-auto
class.
Cards grid
Use the tailwind grid
class and its
grid-cols-*
classes to control how many grid columns (wrapped
around your cards) you show per row. For example, here's
.grid-cols-1
laying out the cards on one column, and
.md:grid-cols-2
splitting four cards to equal width across
multiple rows, from the medium breakpoint up.
Card title
This is a longer 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 longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Change it to .grid-cols-3
and you'll see the fourth card
wrap.
Card title
This is a longer 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 longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
When you need equal height, remove the .self-start
from the
cards.
Card title
This is a longer 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 longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Just like with card groups, card footers will automatically line up.