--- title: Card summary: A card groups related content in one box, with an optional header, footer, image and actions, and it's the building block of most Tabler pages. description: Organize content with flexible cards. Combine headers, footers, images, and actions to build sections that work on any screen size. related: [/ui/components/card-gradient, /ui/components/ribbon] source: core/scss/ui/_cards.scss css-vars: card classnames: component: - class: card desc: Container element part: - class: card-header desc: Title bar at the top - class: card-title desc: Heading, inside the header or the body - class: card-subtitle desc: Small label above the title - class: card-body desc: Content area - class: card-footer desc: Row at the bottom - class: card-meta desc: Muted secondary line, for a role or a date - class: card-actions desc: Slot for controls on the trailing edge of the header - class: card-btn desc: Full width action along the bottom edge - class: card-img-top desc: Image above the body; card-img-end rounds the trailing corners instead - class: card-img-overlay desc: Content laid over an image; add card-img-overlay-dark for a scrim - class: card-cover desc: Header with a background photo and an overlay; card-cover-blurred blurs it - class: card-stamp desc: Large decorative mark in the corner - class: card-status-top desc: Colored bar on an edge; also -bottom and -start - class: card-progress desc: Progress bar attached to the card edge - class: card-tabs desc: Wrapper for a card whose header is a row of tabs - class: card-header-tabs desc: Tabs inside the header; card-header-pills for the pill style - class: card-table desc: Table that sits flush inside the card - class: card-code desc: Replaces the body for a code block, removing the padding - class: card-list-group desc: List group that sits flush inside the card style: - class: card-borderless desc: Removes the border - class: card-transparent desc: Removes the background and the border - class: card-dashed desc: Dashed border, for an empty or a placeholder card modifier: - class: card-stacked desc: Draws a second card behind this one - class: card-rotate-start desc: Tilts the card; also -end, -left and -right - class: card-body-scrollable desc: Scrolls the body instead of growing the card behavior: - class: card-active desc: Marks the card as selected - class: card-inactive desc: Dims the card - class: card-link desc: Whole card is a link; -pop and -rotate add a hover effect size: - class: card-sm desc: Tighter padding - class: card-md desc: Default padding - class: card-lg desc: Roomier padding --- import Example from '@components/Example.astro'; import Icon from '@ui/Icon.astro'; ## Default card Use the `.card` and `.card-body` classes to create a card and use it as the basis for a more advanced card design. A card groups related content in one box with a border and a background, and it's the building block of most Tabler pages.

This is some text within a card body.

## Card padding You can change the padding of a newly created card. To do it, use the `.card-sm`, `.card-md` or `.card-lg` classes. `.card-sm` fits small items such as widgets, and `.card-lg` gives long text more room. On small screens the padding shrinks on its own.
This is some text within a card body.
This is some text within a card body.
This is some text within a card body.
This is some text within a card body.
## Card with title Add a title to your card by including the `.card-title` class within `.card-body`. You can also place the title inside the `.card-header` element to separate the title from the content with a horizontal line.

Card title

This is some text within a card body.

Card title

This is some text within a card body.

## Card with title and image Combine a title with an image at the top. The image takes the full card width and the title sits in the body below it.

Card with title and image

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam deleniti fugit incidunt, iste, itaque minima neque pariatur perferendis sed suscipit velit vitae voluptatem.

## Blog post card A blog post card puts an image with the `.card-img-top` class at the top of the `.card`. The `.d-flex` and `.flex-column` classes on `.card-body`, together with `mt-auto` on the author row, keep the author details at the bottom even when the excerpt is short.

How do you know she is a witch?

Are you suggesting that coconuts migrate? No, no, no! Yes, yes. A bit. But she's got a wart. You ...
Maryjo Lebarree
3 days ago
## Row deck Add the `.row-deck` class to `.row` to display several cards next to one another with the same height.
Short content
Extra long content of card. Lorem ipsum dolor sit amet, consetetur sadipscing elitr
Short content
## Post card with aside image You can also put the image beside the text instead of above it. Use a `row row-0` inside the card, give the image column a fixed width, and let the body take the rest. `object-cover` on the image keeps it filling its column without distortion.

Shut up!

Burn her! How do you know she is a witch? You don't frighten us, English pig-dogs! Go and boil yo...
Egan Poetz
3 days ago
## Card stamp Use a card stamp to put a large, faded icon in the top corner of a card. It is only a decoration, so it never covers the text and it does not react to clicks. Add a `.card-stamp` element as a direct child of the card, before the card body. Put the icon in a `.card-stamp-icon` element inside it.

Card with a stamp

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam deleniti fugit incidunt, iste, itaque minima neque pariatur.

## Card stamp size and color Add the `card-stamp-lg` class to make the stamp bigger. Change the circle color with a `bg-*` class, and the icon color with a `text-*` class.

Large stamp

The large stamp is a good fit for banners and wide cards.

Stamp on a color card

Use a white circle with a colored icon on a card with a background color.

## Stacked card The `card-stacked` class draws a second card edge behind the card, so it looks like a small pile. Use it to hint that there is more than one item, for example a group of similar entries.

Stacked card

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam deleniti fugit incidunt, iste, itaque minima neque pariatur perferendis sed suscipit velit vitae voluptatem.

## Tabbed card Wrap several cards in `.card-tabs` and put a `.nav-tabs` list above them to switch between them with [tabs](/ui/components/tab). Only one card is visible at a time, so it's a way to fit more content into the same space.
Content of tab #1

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci, alias aliquid distinctio dolorem expedita, fugiat hic magni molestiae molestias odit.

Content of tab #2

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci, alias aliquid distinctio dolorem expedita, fugiat hic magni molestiae molestias odit.

Content of tab #3

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci, alias aliquid distinctio dolorem expedita, fugiat hic magni molestiae molestias odit.

Content of tab #4

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci, alias aliquid distinctio dolorem expedita, fugiat hic magni molestiae molestias odit.

## Card status Add a status color to the top, bottom or side of a card. Use `card-status-top`, `card-status-bottom` or `card-status-start` with a `bg-*` color.
Top status
Bottom status
Side status
## Card progress Put a progress bar at the edge of a card with `card-progress`. It squares off against the card corners, so use it as the first or the last child.

Storage

484 GB of 512 GB used

## Card actions Use `card-actions` for buttons and links in a card header. It keeps them aligned with the title.

Team members

Invite a teammate to this project.
## Card subtitle Add `card-subtitle` above a title for a small label, such as a category or a date.

Reports

Monthly summary

Every report from the last 30 days.

## Card surfaces Change how solid a card looks. `card-borderless` drops the border, `card-dashed` draws it dashed, and `card-transparent` removes the background as well - useful for an "add new" tile.
Borderless
Dashed
Add new
## Header and footer variants `card-header-light` tints the header, and `card-footer-transparent` drops the footer background and its top padding.

Invoice #4321

Paid on 12 May.
## Scrollable body Add `card-body-scrollable` with a height to keep a long list inside the card instead of stretching it.

Changelog

Fixed the dropdown position inside a card.

Added a dark variant to the image overlay.

Improved the contrast of muted text.

Removed the unused card options markup.

Documented the scrollable card body.

## Table in a card Add `card-table` to a table so it runs edge to edge and drops its bottom margin.

Invoices

Number Status
#4321 Paid
#4322 Pending
## Clickable card Make the whole card a link with `card-link`. Add `card-link-pop` to lift it on hover, or `card-link-rotate` to tilt it.
## Card states `card-active` marks the selected card, and `card-inactive` fades one out until it is hovered.
Active card
Inactive card
## Image overlay Put content on top of an image with `card-img-overlay`. Add `card-img-overlay-dark` for a gradient that keeps light text readable.

Working from home

Text stays readable over the photo.

## Card cover Use `card-cover` for a header with a background photo. It darkens the image with an overlay, so white text on top stays readable whatever the picture looks like. Add `card-cover-blurred` to blur the photo behind that overlay.
Reading list
12 books this year
Standard overlay.
Reading list
12 books this year
Blurred variant.
## Pills in a card header Tabs in a card header take `card-header-tabs`. For the pill style, use `card-header-pills` on the same `nav`.
Card content
## Image on the trailing side `card-img-top` rounds the top corners of an image, and `card-img-end` rounds the trailing ones. Use it when the image sits beside the text rather than above it, so its corners follow the card.

Card with a side image

The image keeps the rounded corner on the trailing edge of the card.
## Card action button Use `card-btn` for a full-width action at the bottom of a card. It gets a top border, centers its content and highlights on hover, so several of them side by side read as one button bar.
Egan Poetz
Product Manager
`card-meta` above is the muted secondary line that goes with a title - a role, a date, an author. ## Rotated card Add one of the `card-rotate-*` classes to tilt a card slightly. Use it for a stack of cards or a decorative section header, not for content users have to read. | Class | Tilt | | --- | --- | | `card-rotate-start` | towards the start edge | | `card-rotate-end` | towards the end edge | | `card-rotate-left` | left, regardless of text direction | | `card-rotate-right` | right, regardless of text direction |
Rotated to the start
Rotated to the end
## Code in a card `card-code` replaces the card body when the card holds a code block. It removes the body padding and the border the highlighter adds, so the code sits flush against the card edges.

Card with code

```scss .card-footer { background: transparent; } ```
Use it instead of `card-body`, not next to it. ## Accessibility A card is a container, so it has no role of its own. What matters is the content inside it. - Keep one heading per card and match its level to the page outline. `card-title` only sets the look, so use a real `h2`-`h4` element. - For a clickable card, wrap the card in a single `a` element (`card-link`) rather than putting a link only on the title. That way the whole card is one tab stop with one accessible name. - `card-status-*` and `card-stamp` are decoration. Never let a color or an icon be the only carrier of meaning - repeat it in text, for example with a [status](/ui/components/status) or a [badge](/ui/components/badge). - Give an image inside a card a real `alt` when it carries information, or an empty `alt=""` when it is decorative.