Components/Card/Card

fd-card · 13 examples from SAP's documentation · Back to the gallery

About

The Card is a container that consists of a Header, Extended Header, Numeric Content, Content and Footer area. It takes the width of its parent. An additional Media Block is optional. The Header could be placed either above or below the Content and is not separated with a line. All building blocks are optional. **Cards can display different types of content, such as:**

Non-interactive card

Non-interactive cards have role="region". In this case the card can be placed in any container. This role covers the interactive variants: - no interactivity - no interactivity with interactive elements inside (including interactive header).

Non-interactive header
Card Subtitle
1 of 3
Interactive Header
Card Subtitle
1 of 3
2 hours ago
image of a sunset over mountains
Card with Media
Card Subtitle
2 hrs ago
Request Approval
Marie Johnson
2 of 5
1h ago
Travel to Las Vegas
May 3rd - 5th
3,954.00
EUR

Header Interaction - non-interactive Cards

For interactive header use the modifier class .fd-card__header--interactive on .fd-card__header.

Normal state
Card Subtitle
Hover on header
Card Subtitle
Active Header
Card Subtitle
Focus Header
Card Subtitle
badge
Focus Header
Card Subtitle
badge
Focus Header
Card Subtitle
badge
Focus Header
Card Subtitle
Timestamp

Interactive card with role button

The role button can be assigned to an interactive card that has NO interactive element inside. In this case, the card could be placed in any container.

Interactive header
Card Subtitle
Interactive header
With nested button
1 of 3

Interactive card with role listitem

The listitem is the recommended role for card. With this role, all interactive variants of the card can be covered: - Non-interactive card - Non-interactive card with interactive elements inside - Interactive card - Interactive card with interactive elements Only the list item role allows nested interactions, which means: the card can be interactive itself while also having interactive elements inside. It is not recommended to use interactive cards outside list containers! The card container must be a list, even when there's only one card. The container of the list has role region and aria-label. If there's no container for the list, the label has to be placed on the card container list.

Interactive Cards and States

Normal State
Card Subtitle
Hover state
Card Subtitle
Active state
Card Subtitle
Focus state
Card Subtitle
Selected state
Card Subtitle

Standard card | Main Header

The main card header block shows the basic information of the card. It comes in two interactivity variants: - non-interactive: default - interactive: add the .fd-card__header--interactive modifier class to the .fd-card__header base class. Building blocks of the Main Header: - title: title is mandatory to explain what content is being displayed to the user. It wraps 3 lines. - avatar (optional): avatar should be displayed in a size S (3rem). - subtitle (optional): the subtitle provides additional context to the title or displays a status. Its usage depends on the card type. Subtitles that exceed one line are truncated with an ellipsis (it wraps 2 lines). - counter (optional): the counter indicates how many items are showing on the card in relation to the total number of relevant items. If all the relevant items are visible on the card, no counter is shown. There is also no counter if there is an issue loading a card, or if no items are found in the filter criteria. The counter is right-aligned and is never truncated. - interactive element (optional): like an icon button.

Non-interactive header
Card Subtitle
1 of 3
Interactive header
Card Subtitle
1 of 3
badge
Card title that truncates lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit, enim. Aliquam magnam vel culpa eos explicabo. Labore laboriosam omnis explicabo natus doloremque enim, voluptatum consequuntur excepturi, reprehenderit similique, repellendus commodi.
Card subtitle that truncates lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit, enim. Aliquam magnam vel culpa eos explicabo. Labore laboriosam omnis explicabo natus doloremque enim, voluptatum consequuntur excepturi, reprehenderit similique, repellendus commodi.
1 of 3
Card with main, extended and numeric headers
Card subtitle
1 of 3
Positive
Timestamp
1Ñç
M
Indicator 1
500k
Indicator 2
500k
badge lorem ipsum dolor sit amet consectetur adipisicing elit. Repudiandae distinctio natus aperiam doloremque beatae quas, fuga sequi iste officia similique sunt, iusto ad obcaecati voluptatum. Commodi perferendis assumenda modi laudantium.
Card with Badge
Badge text truncates
badge
Card with Badge
Badge with icon

ExtendedHeader

The Extended header is a flexible block to hold various other components, like time stamp, rating, tags, label/value, long text, numeric values, etc. The components can be arranged in left column or right column, each column is suggested to have maximum 3 lines for placing the components. - .fd-card__header-extended--top-aligned and .fd-card__header-extended--bottom-aligned modifier classes applied with the .fd-card__header-extended base class will align the content of the columns vertically to the top or the bottom (default is center). - .fd-card__header-column--right-aligned modifier class for .fd-card__header-column will align the content of the column to the right.

Card Title
Card Subtitle
1 of 3
Positive Informative
Timestamp
Card Title
Card Subtitle
1 of 3
Approved
Travel Request
SAP Sapphire Barcelona
Travel ID: 123456
June 16, 2024
Card Title
Card Subtitle
1 of 3
Overdue
Invoice ID 987654321
EUR 10,000.00, due 26/06/2024
Card Title
Card Subtitle
1 of 3
(205)

NumericHeader

The numeric header block is designed for displaying numeric information.

Card Title
Card Subtitle
1 of 3
1Ñç
M
Indicator 1
500k
Indicator 2
500k

Alternative Icon on Card Header

Alternatively to an Avatar a Message Icon can be displayed within the Main Header. This will be available in three different sizes (this is only applicable for Message Icons not Avatar component on Card Header). The Message Icons are non-interactive. Icon Sizes Size font-size Icon Modifier Class S 1rem .sap-icon--sm M 2rem .sap-icon--md L 3rem .sap-icon--lg Semantic Notification / Message Icons Description Icon Name Icon Modifier Class Color Modifier Class Negative Notification error .sap-icon--error .sap-icon--color-negative Critical Notification alert .sap-icon--alert .sap-icon--color-critical Positive Notification sys-enter-2 .sap-icon--sys-enter-2 .sap-icon--color-positive Information Notification information .sap-icon--information .sap-icon--color-information Neutral Notification sys-help-2 .sap-icon--sys-help-2 .sap-icon--color-neutral

Non-interactive header
Card Subtitle
1 of 3
Interactive Header
Card Subtitle
1 of 3
Request Approval
Marie Johnson
2 of 5
Travel to Las Vegas
May 3rd - 5th
3,954.00
EUR

Empty State

Use Illustrated Messages component inside the Card content to represent an empty state. The content container has 1rem spacing.

Card Title
Card Subtitle

Unable to load data

Try reloading, if that doesn't help check with your administratior.

Analytical card

The analytical card is used for data visualization. It can display a KPI header and various chart types in the content. The only difference between a KPI header and a standard header is that the former requires a subtitle, a KPI area and can display an optional second subtitle. To display an analytical card, add the \

Card Title
Counter
Card Subtitle
Currency
1Ñç
M
Target
110K
Deviation
-35.7%
Second Subtitle
Card Title With a Very Long Text ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Counter
Card Subtitle With a Very Long Text ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Currency
1Ñç
M
Target
110K
Deviation
-35.7%
Second Subtitle With a Very Long Text ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
badge

List card

A card can display various types of lists. All components placed inside should behave natively. For this kind of card it is not recommended to keep header interactive, or navigable.

Quick Links
2 of 20
  • List item 1
  • List item 2
  • List item 3
  • List item 4
  • List item 3
  • List item 4

Table card

Cards can display tables within the content area. To display a table card, add the `fd-card--table` modifier class to the main element.

Table Card
2 of 20
Name Status Price Country
Banana Available 5 EUR India
Pineapple Out of stock 2 EUR Mexico
Orange Temporary unavailable 6 EUR Spain

Object card

The object card can display a single object or a group of objects. Contrary to other cards, object card has 1rem padding on all sides of the content area. To display an object card, add the \

Card Title
Card Subtitle
Group Title 1
Label Text
Label Text
Label Text
Group Title 2
Label Text
Label Text
Label Only
Card Title
Card Subtitle

Group Title 1

Label Link Text
Label Text
Label Text

Group Title 2

Label
Label Text
Label Text