Share This Post

复制链接
分享至X
分享至 LinkedIn
分享至 Facebook

Card

Share This Post

复制链接
分享至X
分享至 LinkedIn
分享至 Facebook

Share This Post

复制链接
分享至X
分享至 LinkedIn
分享至 Facebook

Card

Share This Post

复制链接
分享至X
分享至 LinkedIn
分享至 Facebook

Share This Post

复制链接
分享至X
分享至 LinkedIn
分享至 Facebook

Card

Share This Post

复制链接
分享至X
分享至 LinkedIn
分享至 Facebook

What is Card

A card is a small box that organizes and highlights related information, helping it stand out on a page. It often has a border or shadow to indicate separation and may include a background, image, text, or buttons. Cards come in various shapes and sizes to suit different content.

Anatomy Card

  • Card header (optional): Top section for titles or key info.

  • Card preview: The main section with visuals or text to convey primary content, often includes multimedia or concise info.

  • Card footer (optional): Bottom section for extra info or actions.

Core Features

  • Content Grouping: Cards organize related information neatly in compact boxes.

  • Reusable Design: They act as versatile building blocks for various layouts and styles.

  • Content Variety: Cards can hold images, text, buttons, lists, etc.

  • Component Integration: They work well with other elements for complex designs.

  • Flexibility: Cards adapt in size and layout to fit their content.

Comparison of Usage in Popular Design Systems

Now, let's look at how some well-known design systems define and implement cards: Explore how design systems like Material Design, Fluent Design, and Ant Design define and use cards. Compare their features, placement, and responsiveness to find the best fit for your project.

Default styles

Enumerates the default appearances of cards across various design systems, highlighting their visual characteristics and usability.

Material Design 3 Card

Material Design 3 Card

Material Design 3 Card

Material Design 3 Card

Fluent 2 Design Card

Fluent 2 Design Card

Fluent 2 Design Card

Fluent 2 Design Card

Ant Design Card

Ant Design Card

Ant Design Card

Ant Design Card

Lightning Design Card

Lightning Design Card

Lightning Design Card

Lightning Design Card

Bootstrap v5.3 Design Card

Bootstrap v5.3 Design Card

Bootstrap v5.3 Design Card

Bootstrap v5.3 Design Card

Orbit Design Card

Orbit Design Card

Orbit Design Card

Orbit Design Card

Features comparison in Design Systems

Comparing cards in Material, Orbit, Fluent, Lightning, Ant, and Bootstrap design systems reveals differences in structure and interaction. Some split cards into header, footer, and preview, while others use only header and body. Similarly, some systems include hover effects, while others do not.

Design System

Defines

Structure

Interaction State

Cards display content and actions about a single subject

  • Container

  • Headline

  • Subhead

  • Supporting text

  • Image

  • Button

  • Hovered

  • Focused

  • Pressed

  • Dragged

  • Disabled

A card is a container containing information and actions related to a single concept or object, like a document or a contact.

  • Card Header

  • Card Preview

  • Card Footer

  • Cards can include buttons and links for multiple actions. 

  • If there’s one main action, the entire card can act as a button. 

  • Cards also support checkboxes or radio groups for selection.

A container for displaying information.

  • Header

  • Body

  • Extra

  • Title

  • Actions

  • Cover

Support interaction with the action buttons. 

The card itself has a hover state.

Cards are used to apply a container around a related grouping of information.

  • Header

  • Body

  • Footer

Support interaction with the action buttons. 

Bootstrap’s cards provide a flexible and extensible content container with multiple variants and options.

  • Headers

  • Body

Support interaction with the action buttons. 

Separates content into sections.

  • Title

  • Description

  • Action

  • Closed card section

  • Expanded card section

Support interaction with the action buttons in the card.

Special Types

Ant Design supports “With tabs”.

Add navigation to a card’s header using Ant's Tabs component to host more content.

Bootstrap Design supports colorful card styles.

Preset a series of colorful card styles for use in different situations.

Fluent Design System supports  “With checkboxes”.

Cards can also let people make a selection, similar to checkboxes or radio groups.

Card Template for Motiff

This UIkit file integrates tooltip components from Material, Fluent, Lightning, Ant, Bootstrap, and Orbit Design Systems, offering styles, usage, and customization options in one place for easy exploration and selection.

Open and edit in Motiff →

What is the difference between card and tile components?

Cards and tiles differ mainly in semantics, use cases, and user expectations. When deciding between a Card and a tile, refer to these key differences, which are adapted from a Stack Overflow discussion

  • Semantic difference: Tiles are for navigation or quick info and often link to other screens, while cards are self-contained and provide complete information.

  • Usage and placement: Tiles are flexible, ideal for dashboards or navigation; cards are fixed, and better for detailed content or task tracking.

  • User expectations: Users expect tiles to provide quick access or updates and links to further details. Cards are expected to display complete information at a glance, with minimal interaction like flipping or expanding. Misusing one in place of the other can lead to confusion or frustration.

Accessibility in Different Design Systems

Common Practices

A card is a modular UI component used to show independent information or functional units.

  • Layered Structure: Cards typically include a title, body, action area (buttons/links), and optional media (images/videos).

  • Flexible Layout: Cards are responsive, adapting to various screen sizes.

  • Information Hierarchy: Font size, color, or icons separate primary and secondary content.

  • Spacing Guidelines: Padding and margins follow design rules for a clean layout.

Differences Practices

  • Ant Design: Built-in loading state for asynchronous data loading scenarios.

  • Material Design (Google): Emphasizes visual effects, enhancing user experience through animations and shadows.

  • Fluent Design System: Cards can be used to let people make a selection, similar to checkboxes or radio groups.

  • Orbit Design System: The purpose of a card component is to separate and organize information.

  • Bootstrap: The text alignment in cards is not limited to left alignment. it also includes center alignment and right alignment.

  • Lightning Design System: Supports accessible drag-and-drop operations for reordering cards.

Code Examples

Explore default card implementations in Fluent, Lightning, Ant, and Bootstrap design systems. These examples showcase standard usage, default settings, and core features across design systems.

Fluent 2 Design System

import * as React from "react";

import {
  makeStyles,
  Body1,
  Caption1,
  Button,
} from "@fluentui/react-components";
import { ArrowReplyRegular, ShareRegular } from "@fluentui/react-icons";
import {
  Card,
  CardFooter,
  CardHeader,
  CardPreview,
} from "@fluentui/react-components";

const resolveAsset = (asset: string) => {
  const ASSET_URL =
    "https://raw.githubusercontent.com/microsoft/fluentui/master/packages/react-components/react-card/stories/src/assets/";

  return `${ASSET_URL}${asset}`;
};

const useStyles = makeStyles({
  card: {
    margin: "auto",
    width: "720px",
    maxWidth: "100%",
  },
});

export const Default = () => {
  const styles = useStyles();

  return (
    <Card className={styles.card}>
      <CardHeader
        image={
          <img
            src={resolveAsset("avatar_elvia.svg")}
            alt="Elvia Atkins avatar picture"
          />
        }
        header={
          <Body1>
            <b>Elvia Atkins</b> mentioned you
          </Body1>
        }
        description={<Caption1>5h ago · About us - Overview</Caption1>}
      />

      <CardPreview
        logo={
          <img src={resolveAsset("docx.png")} alt="Microsoft Word document" />
        }
      >
        <img
          src={resolveAsset("doc_template.png")}
          alt="Preview of a Word document: About Us - Overview"
        />
      </CardPreview>

      <CardFooter>
        <Button icon={<ArrowReplyRegular fontSize={16} />}>Reply</Button>
        <Button icon={<ShareRegular fontSize={16} />}>Share</Button>
      </CardFooter>
    </Card>
  );
};

Show More

import * as React from "react";

import {
  makeStyles,
  Body1,
  Caption1,
  Button,
} from "@fluentui/react-components";
import { ArrowReplyRegular, ShareRegular } from "@fluentui/react-icons";
import {
  Card,
  CardFooter,
  CardHeader,
  CardPreview,
} from "@fluentui/react-components";

const resolveAsset = (asset: string) => {
  const ASSET_URL =
    "https://raw.githubusercontent.com/microsoft/fluentui/master/packages/react-components/react-card/stories/src/assets/";

  return `${ASSET_URL}${asset}`;
};

const useStyles = makeStyles({
  card: {
    margin: "auto",
    width: "720px",
    maxWidth: "100%",
  },
});

export const Default = () => {
  const styles = useStyles();

  return (
    <Card className={styles.card}>
      <CardHeader
        image={
          <img
            src={resolveAsset("avatar_elvia.svg")}
            alt="Elvia Atkins avatar picture"
          />
        }
        header={
          <Body1>
            <b>Elvia Atkins</b> mentioned you
          </Body1>
        }
        description={<Caption1>5h ago · About us - Overview</Caption1>}
      />

      <CardPreview
        logo={
          <img src={resolveAsset("docx.png")} alt="Microsoft Word document" />
        }
      >
        <img
          src={resolveAsset("doc_template.png")}
          alt="Preview of a Word document: About Us - Overview"
        />
      </CardPreview>

      <CardFooter>
        <Button icon={<ArrowReplyRegular fontSize={16} />}>Reply</Button>
        <Button icon={<ShareRegular fontSize={16} />}>Share</Button>
      </CardFooter>
    </Card>
  );
};

Show More

import * as React from "react";

import {
  makeStyles,
  Body1,
  Caption1,
  Button,
} from "@fluentui/react-components";
import { ArrowReplyRegular, ShareRegular } from "@fluentui/react-icons";
import {
  Card,
  CardFooter,
  CardHeader,
  CardPreview,
} from "@fluentui/react-components";

const resolveAsset = (asset: string) => {
  const ASSET_URL =
    "https://raw.githubusercontent.com/microsoft/fluentui/master/packages/react-components/react-card/stories/src/assets/";

  return `${ASSET_URL}${asset}`;
};

const useStyles = makeStyles({
  card: {
    margin: "auto",
    width: "720px",
    maxWidth: "100%",
  },
});

export const Default = () => {
  const styles = useStyles();

  return (
    <Card className={styles.card}>
      <CardHeader
        image={
          <img
            src={resolveAsset("avatar_elvia.svg")}
            alt="Elvia Atkins avatar picture"
          />
        }
        header={
          <Body1>
            <b>Elvia Atkins</b> mentioned you
          </Body1>
        }
        description={<Caption1>5h ago · About us - Overview</Caption1>}
      />

      <CardPreview
        logo={
          <img src={resolveAsset("docx.png")} alt="Microsoft Word document" />
        }
      >
        <img
          src={resolveAsset("doc_template.png")}
          alt="Preview of a Word document: About Us - Overview"
        />
      </CardPreview>

      <CardFooter>
        <Button icon={<ArrowReplyRegular fontSize={16} />}>Reply</Button>
        <Button icon={<ShareRegular fontSize={16} />}>Share</Button>
      </CardFooter>
    </Card>
  );
};

Show More

import * as React from "react";

import {
  makeStyles,
  Body1,
  Caption1,
  Button,
} from "@fluentui/react-components";
import { ArrowReplyRegular, ShareRegular } from "@fluentui/react-icons";
import {
  Card,
  CardFooter,
  CardHeader,
  CardPreview,
} from "@fluentui/react-components";

const resolveAsset = (asset: string) => {
  const ASSET_URL =
    "https://raw.githubusercontent.com/microsoft/fluentui/master/packages/react-components/react-card/stories/src/assets/";

  return `${ASSET_URL}${asset}`;
};

const useStyles = makeStyles({
  card: {
    margin: "auto",
    width: "720px",
    maxWidth: "100%",
  },
});

export const Default = () => {
  const styles = useStyles();

  return (
    <Card className={styles.card}>
      <CardHeader
        image={
          <img
            src={resolveAsset("avatar_elvia.svg")}
            alt="Elvia Atkins avatar picture"
          />
        }
        header={
          <Body1>
            <b>Elvia Atkins</b> mentioned you
          </Body1>
        }
        description={<Caption1>5h ago · About us - Overview</Caption1>}
      />

      <CardPreview
        logo={
          <img src={resolveAsset("docx.png")} alt="Microsoft Word document" />
        }
      >
        <img
          src={resolveAsset("doc_template.png")}
          alt="Preview of a Word document: About Us - Overview"
        />
      </CardPreview>

      <CardFooter>
        <Button icon={<ArrowReplyRegular fontSize={16} />}>Reply</Button>
        <Button icon={<ShareRegular fontSize={16} />}>Share</Button>
      </CardFooter>
    </Card>
  );
};

Show More

Ant Design

import React from 'react';
import { Card, Space } from 'antd';

const App: React.FC = () => (
  <Space direction="vertical" size={16}>
    <Card title="Default size card" extra={<a href="#">More</a>} style={{ width: 300 }}>
      <p>Card content</p>
      <p>Card content</p>
      <p>Card content</p>
    </Card>
    <Card size="small" title="Small size card" extra={<a href="#">More</a>} style={{ width: 300 }}>
      <p>Card content</p>
      <p>Card content</p>
      <p>Card content</p>
    </Card>
  </Space>
);

export default App;

Show More

import React from 'react';
import { Card, Space } from 'antd';

const App: React.FC = () => (
  <Space direction="vertical" size={16}>
    <Card title="Default size card" extra={<a href="#">More</a>} style={{ width: 300 }}>
      <p>Card content</p>
      <p>Card content</p>
      <p>Card content</p>
    </Card>
    <Card size="small" title="Small size card" extra={<a href="#">More</a>} style={{ width: 300 }}>
      <p>Card content</p>
      <p>Card content</p>
      <p>Card content</p>
    </Card>
  </Space>
);

export default App;

Show More

import React from 'react';
import { Card, Space } from 'antd';

const App: React.FC = () => (
  <Space direction="vertical" size={16}>
    <Card title="Default size card" extra={<a href="#">More</a>} style={{ width: 300 }}>
      <p>Card content</p>
      <p>Card content</p>
      <p>Card content</p>
    </Card>
    <Card size="small" title="Small size card" extra={<a href="#">More</a>} style={{ width: 300 }}>
      <p>Card content</p>
      <p>Card content</p>
      <p>Card content</p>
    </Card>
  </Space>
);

export default App;

Show More

import React from 'react';
import { Card, Space } from 'antd';

const App: React.FC = () => (
  <Space direction="vertical" size={16}>
    <Card title="Default size card" extra={<a href="#">More</a>} style={{ width: 300 }}>
      <p>Card content</p>
      <p>Card content</p>
      <p>Card content</p>
    </Card>
    <Card size="small" title="Small size card" extra={<a href="#">More</a>} style={{ width: 300 }}>
      <p>Card content</p>
      <p>Card content</p>
      <p>Card content</p>
    </Card>
  </Space>
);

export default App;

Show More

Lightning Design System

<article class="slds-card">
<div class="slds-card__header slds-grid">
<header class="slds-media slds-media_center slds-has-flexi-truncate">
<div class="slds-media__figure">
<span class="slds-icon_container slds-icon-standard-account" title="account">
<svg class="slds-icon slds-icon_small" aria-hidden="true">
<use xlink:href="/assets/icons/standard-sprite/svg/symbols.svg#account"></use>
</svg>
<span class="slds-assistive-text">account</span>
</span>
</div>
<div class="slds-media__body">
<h2 class="slds-card__header-title">
<a href="#" class="slds-card__header-link slds-truncate" title="Accounts">
<span>Accounts</span>
</a>
</h2>
</div>
<div class="slds-no-flex">
<button class="slds-button slds-button_neutral">New</button>
</div>
</header>
</div>
<div class="slds-card__body slds-card__body_inner">Anything can go into the card body</div>
<footer class="slds-card__footer">
<a class="slds-card__footer-action" href="#">View All
<span class="slds-assistive-text">Accounts</span>
</a>
</footer>
</article>

Show More

<article class="slds-card">
<div class="slds-card__header slds-grid">
<header class="slds-media slds-media_center slds-has-flexi-truncate">
<div class="slds-media__figure">
<span class="slds-icon_container slds-icon-standard-account" title="account">
<svg class="slds-icon slds-icon_small" aria-hidden="true">
<use xlink:href="/assets/icons/standard-sprite/svg/symbols.svg#account"></use>
</svg>
<span class="slds-assistive-text">account</span>
</span>
</div>
<div class="slds-media__body">
<h2 class="slds-card__header-title">
<a href="#" class="slds-card__header-link slds-truncate" title="Accounts">
<span>Accounts</span>
</a>
</h2>
</div>
<div class="slds-no-flex">
<button class="slds-button slds-button_neutral">New</button>
</div>
</header>
</div>
<div class="slds-card__body slds-card__body_inner">Anything can go into the card body</div>
<footer class="slds-card__footer">
<a class="slds-card__footer-action" href="#">View All
<span class="slds-assistive-text">Accounts</span>
</a>
</footer>
</article>

Show More

<article class="slds-card">
<div class="slds-card__header slds-grid">
<header class="slds-media slds-media_center slds-has-flexi-truncate">
<div class="slds-media__figure">
<span class="slds-icon_container slds-icon-standard-account" title="account">
<svg class="slds-icon slds-icon_small" aria-hidden="true">
<use xlink:href="/assets/icons/standard-sprite/svg/symbols.svg#account"></use>
</svg>
<span class="slds-assistive-text">account</span>
</span>
</div>
<div class="slds-media__body">
<h2 class="slds-card__header-title">
<a href="#" class="slds-card__header-link slds-truncate" title="Accounts">
<span>Accounts</span>
</a>
</h2>
</div>
<div class="slds-no-flex">
<button class="slds-button slds-button_neutral">New</button>
</div>
</header>
</div>
<div class="slds-card__body slds-card__body_inner">Anything can go into the card body</div>
<footer class="slds-card__footer">
<a class="slds-card__footer-action" href="#">View All
<span class="slds-assistive-text">Accounts</span>
</a>
</footer>
</article>

Show More

<article class="slds-card">
<div class="slds-card__header slds-grid">
<header class="slds-media slds-media_center slds-has-flexi-truncate">
<div class="slds-media__figure">
<span class="slds-icon_container slds-icon-standard-account" title="account">
<svg class="slds-icon slds-icon_small" aria-hidden="true">
<use xlink:href="/assets/icons/standard-sprite/svg/symbols.svg#account"></use>
</svg>
<span class="slds-assistive-text">account</span>
</span>
</div>
<div class="slds-media__body">
<h2 class="slds-card__header-title">
<a href="#" class="slds-card__header-link slds-truncate" title="Accounts">
<span>Accounts</span>
</a>
</h2>
</div>
<div class="slds-no-flex">
<button class="slds-button slds-button_neutral">New</button>
</div>
</header>
</div>
<div class="slds-card__body slds-card__body_inner">Anything can go into the card body</div>
<footer class="slds-card__footer">
<a class="slds-card__footer-action" href="#">View All
<span class="slds-assistive-text">Accounts</span>
</a>
</footer>
</article>

Show More

Bootstrap v5.3

<div class="card" style="width: 18rem;">
  <img src="..." class="card-img-top" alt="...">
  <div class="card-body">
    <h5 class="card-title">Card title</h5>
    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
    <a href="#" class="btn btn-primary">Go somewhere</a>
  </div>
</div>
<div class="card" style="width: 18rem;">
  <img src="..." class="card-img-top" alt="...">
  <div class="card-body">
    <h5 class="card-title">Card title</h5>
    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
    <a href="#" class="btn btn-primary">Go somewhere</a>
  </div>
</div>
<div class="card" style="width: 18rem;">
  <img src="..." class="card-img-top" alt="...">
  <div class="card-body">
    <h5 class="card-title">Card title</h5>
    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
    <a href="#" class="btn btn-primary">Go somewhere</a>
  </div>
</div>
<div class="card" style="width: 18rem;">
  <img src="..." class="card-img-top" alt="...">
  <div class="card-body">
    <h5 class="card-title">Card title</h5>
    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
    <a href="#" class="btn btn-primary">Go somewhere</a>
  </div>
</div>

Try AI Design Systems

Create, maintain, and check your design systems with AI in one click.

Try AI Design Systems

Create, maintain, and check your design systems with AI in one click.

Try AI Design Systems

Create, maintain, and check your design systems with AI in one click.

Try AI Design Systems

Create, maintain, and check your design systems with AI in one click.

Try AI Design Systems

Create, maintain, and check your design systems with AI in one click.