Skip to content

Card

Cards are versatile containers that group related content and actions. They provide a clean way to present information.

Usage

Use cards to group related content, create visual hierarchy, and provide clear boundaries between sections.

Basic Card

Card Title

This is a basic card with some content. Cards are great for organizing information.

html
<div class="df-card">
  <div class="df-card__body">
    <h3 class="df-card__title">Card Title</h3>
    <p class="df-card__text">Card content goes here.</p>
  </div>
</div>

With Image

Featured Article

A compelling description that makes users want to learn more about this content.

html
<div class="df-card">
  <img class="df-card__image" src="..." alt="...">
  <div class="df-card__body">
    <h3 class="df-card__title">Featured Article</h3>
    <p class="df-card__text">Description here.</p>
  </div>
</div>
Project UpdateActive

The project is progressing well. We've completed 75% of the planned features.

html
<div class="df-card">
  <div class="df-card__header">
    <span class="df-card__header-title">Project Update</span>
    <span class="df-badge df-badge--success">Active</span>
  </div>
  <div class="df-card__body">
    <p class="df-card__text">Content here.</p>
  </div>
  <div class="df-card__footer">
    <button class="df-button">View Details</button>
    <button class="df-button df-button--primary">Take Action</button>
  </div>
</div>

Clickable Card

html
<a href="/page" class="df-card df-card--clickable">
  <div class="df-card__body">
    <h3 class="df-card__title">Click Me</h3>
    <p class="df-card__text">Clickable card content.</p>
  </div>
</a>

Card Variants

Elevated

Elevated Card

Has a subtle shadow for depth.

Outlined

Outlined Card

Uses a border instead of shadow.

Filled

Filled Card

Has a subtle background color.

Card with List

Team Members
  • JD
    John Doe
  • JS
    Jane Smith
  • BW
    Bob Wilson

Horizontal Card

Horizontal Layout

Cards can be laid out horizontally for a different presentation style.

html
<div class="df-card df-card--horizontal">
  <img class="df-card__image" src="..." alt="...">
  <div class="df-card__body">
    <h3 class="df-card__title">Horizontal Layout</h3>
    <p class="df-card__text">Description here.</p>
  </div>
</div>

Card Grid

Card One

First card in the grid.

Card Two

Second card in the grid.

Card Three

Third card in the grid.

html
<div class="df-card-grid">
  <div class="df-card">...</div>
  <div class="df-card">...</div>
  <div class="df-card">...</div>
</div>

Accessibility

  • Use semantic headings for card titles
  • Ensure clickable cards have appropriate focus states
  • Add alt text to card images
  • Use sufficient color contrast

Best Practices

  • Keep card content concise
  • Use consistent card sizes in grids
  • Limit actions to 2-3 per card
  • Consider card loading states for async content

API Reference

Classes

ClassDescription
df-cardBase card class
df-card--elevatedCard with shadow
df-card--outlinedCard with border
df-card--filledCard with background
df-card--clickableInteractive card
df-card--horizontalHorizontal layout
df-card__headerCard header
df-card__bodyCard body
df-card__footerCard footer
df-card__imageCard image
df-card__titleCard title
df-card__textCard text

Built with care by Everforth