Cards¶
A card is a content container to display important and useful information, e.g. trend charts, key data etc.
Usage¶

When to use¶
- To cluster information.
Best practices¶
- Only include the most relevant information.
- Set an appropriate size (height and width) of the card to give the content the space needed to convey the information.
Design¶
Elements¶

1. Header (optional): Card header contains a title and an optional content action bar. 2. Content area: The main area of the card. It can contain any type of content, such as text, graphs, tables.
Cards can also be displayed as outline, without a background. Use this variant when the content should visually blend with the page background while still being grouped as a card.

Images¶
Cards can include an image and be placed either vertically or horizontally.

Accent line¶
An accent line can be used to highlight general, non-critical information. This approach should be reserved for cases where it improves clarity or reinforces the card's purpose.
To prevent overuse and maintain its impact, the accent line should be applied selectively rather than to every card. Use distinct colors, such as $element-ui-0, to emphasize information without implying urgency.

For status indication, refer to the value widget.
Action cards¶
Action cards are interactive elements where the entire container is selectable and triggers a single action. They support hover, pressed, focus, and disabled states. They can also retain a selection state, behaving like a toggle.
Action cards do not include other interactive elements to prevent conflicting interactions.

Card sizes¶

To ensure an aligned visual grid and proper aesthetic of dashboards, card sizes follow the underlying 12 column grid of the work area. The card can span over 3, 4, 6, 9 or 12 columns.

The card's width is defined by a horizontal grid system. The necessary height is primarily driven by the content. For visual aesthetic and reordering reasons, the number of height-sizes should be kept low and consistent.
Full-screen view¶
Cards can be enlarged via the content action menu to get more detailed information. The card then uses the whole working area. This makes sure that primary navigation, statusbar, notifications or other important information for the users are still accessible. Dashboard wide settings like e.g. time-range filter shall not be visible. If Expand is the only content action, then the expand icon is directly accessible, otherwise it will be part of the content actions list.
Responsive behavior¶
With the column grid system in place, cards will first vary their width within certain breakpoints. As the screen size gets smaller and smaller cards will be stacked more and more.
Code¶
Cards support various content structures to organize information effectively. Choose the appropriate pattern based on your content needs.
Below are examples of what’s supported. Consumer can either choose to use a pure CSS approach or the SiCardComponent.
For the maximize/restore functionality to work correctly the cards container/working area needs to have position: relative;.
SiCardComponent¶
import { SiCardComponent } from '@siemens/element-ng/card';
@Component({
imports: [SiCardComponent, ...]
})
The si-card component makes use of the card classes. The header is configurable by input properties (see API). A header icon and the card body are provided using content projection, with the selectors headerIcon and body.
When using header icon, make sure to include spacing between the icon and the heading. In addition, the heading and text within the body should be left aligned.
Try to avoid content overflows in cards. In case of overflows, make sure the scrollbar is placed on the edge of the card and padding is set internally.
import { SiCardComponent } from '@siemens/element-ng/card'; Input Properties¶
| Name | Type | Default | Description |
|---|---|---|---|
| actionBarTitle ¶ | TranslatableString | '' | Optional setting of html title attribute for the content action bar. Helpful for a11y when only one action is configured in expand mode. |
| actionBarViewType ¶ | ViewType | 'collapsible' | The view type of the content action bar of the card. Default is |
| actionParam ¶ | any | A param that will be passed to the | |
| heading inherited ¶ | TranslatableString | undefined | Card header text. Inherited from | |
| imgAlt inherited ¶ | TranslatableString | undefined | Alt text for a provided image. Inherited from | |
| imgDir inherited ¶ | "horizontal" | "vertical" | undefined | 'vertical' | Defines if an image is placed on top or start (left) of the card. Inherited from |
| imgObjectFit inherited ¶ | "fill" | "contain" | "cover" | "none" | "scale-down" | undefined | 'scale-down' | Sets the image object-fit CSS property. Inherited from |
| imgObjectPosition inherited ¶ | string | undefined | Sets the image object-position CSS property. Inherited from | |
| imgSrc inherited ¶ | string | undefined | Image source for the card. Inherited from | |
| primaryActions ¶ | (MenuItem | ContentActionBarMainItem)[] | [] | Input list of primary action items. Supports up to 4 actions and omits additional ones. |
| secondaryActions ¶ | (MenuItem | MenuItem)[] | [] | Input list of secondary action items. |
| subHeading inherited ¶ | TranslatableString | undefined | Card secondary header text. Inherited from |
Attributes and Methods¶
| Name | Type | Default | Description |
|---|---|---|---|
| (readonly)displayContentActionBar ¶ | Signal<boolean> | ... | Returns |
Action cards¶
Action cards make the whole card interactive. Apply si-action-card to a native <button> element for actions or an <a> element for navigation.
- Use
<button si-action-card type="button">to trigger actions, such as opening a dialog. - Use
<a si-action-card>withhreffor standard links orrouterLinkfor Angular routes.
The selectable and selected inputs are supported only on button cards and must not be used on anchor cards. Use a <button> for selectable or disabled cards.
Use routerLinkActive="selected" to highlight the active route. Add RouterLink and RouterLinkActive from @angular/router to your component's imports.
<a
si-action-card
heading="Energy report"
routerLink="/energy-report"
routerLinkActive="selected"
[routerLinkActiveOptions]="{ exact: true }"
ariaCurrentWhenActive="page"
>
<p class="card-body card-text" body>View the energy consumption summary.</p>
</a>
import { SiActionCardComponent } from '@siemens/element-ng/card'; An action card component that supports actions and selection on native buttons, and navigation on native anchors.
Important: The selectable and selected inputs are supported only on button action cards. Do not use them with an anchor.
Usage: as a selectable button card: <button si-action-card selectable type="button" [(selected)]="isSelected">...</button>
or as an action button card: <button si-action-card type="button" (click)="doSomeAction()">...</button>
or as a navigation card: <a si-action-card href="/details">...</a> <a si-action-card routerLink="/details" routerLinkActive="selected">...</a>
Input Properties¶
| Name | Type | Default | Description |
|---|---|---|---|
| heading inherited ¶ | TranslatableString | undefined | Card header text. Inherited from | |
| imgAlt inherited ¶ | TranslatableString | undefined | Alt text for a provided image. Inherited from | |
| imgDir inherited ¶ | "horizontal" | "vertical" | undefined | 'vertical' | Defines if an image is placed on top or start (left) of the card. Inherited from |
| imgObjectFit inherited ¶ | "fill" | "contain" | "cover" | "none" | "scale-down" | undefined | 'scale-down' | Sets the image object-fit CSS property. Inherited from |
| imgObjectPosition inherited ¶ | string | undefined | Sets the image object-position CSS property. Inherited from | |
| imgSrc inherited ¶ | string | undefined | Image source for the card. Inherited from | |
| selectable ¶ | boolean | false | Makes a button action card selectable. |
| selected ¶ | boolean | false | Indicates whether a selectable button action card is selected. |
| subHeading inherited ¶ | TranslatableString | undefined | Card secondary header text. Inherited from |
Output Properties¶
| Name | Type | Description |
|---|---|---|
| selectedChange ¶ | boolean | Indicates whether a selectable button action card is selected. |
Outline cards¶
Outline cards are a variation of cards with a border and no background color. Every card can be turned into an outline card by adding the .card-outline class to the card container.
<si-card class="card-outline"> ... </si-card>
Native HTML markup¶
The pure CSS approach structures a card into three distinct sections for optimal content organization:
- Header (optional): Apply
.card-headerto<h*>elements or<div>for titles and top-level information - Body (required): Apply
.card-bodyfor the main content area with proper padding and spacing - Footer (optional): Apply
.card-footerfor additional information that sticks to the bottom
<div class="card">
<div class="card-header">Card header</div>
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
</div>
<div class="card-footer">Card footer</div>
</div>
Style content elements like titles and text within cards using the semantic classes. Always place these elements inside a .card-body container for proper padding and alignment.
Available content classes:
| Class | Element | Purpose | Usage |
|---|---|---|---|
.card-title | <h1> - <h6> | Primary heading | Main title or heading for the card content |
.card-subtitle | <h1> - <h6> | Secondary heading | Supporting text below the main title, typically smaller and muted |
.card-text | <p> | Body text | Main content paragraphs and descriptive text |
Best practices:
- Use
.card-titlefor the most important heading in each card - Apply
.card-subtitlefor supporting information that enhances the title - Wrap body content in
.card-textfor consistent typography
<div class="card">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<h6 class="card-subtitle mb-2 text-secondary">Card subtitle</h6>
<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>
</div>
</div>
To properly integrate an image with a card, apply the .card-img-top or .card-img-bottom class to your <img> element. This automatically rounds the image's top or bottom corners to match the card's border radius.
<div class="card">
<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>
</div>
</div>
Create organized lists within cards using the list.
<div class="card">
<ul class="list list-divider">
<li class="list-item">An item</li>
<li class="list-item">A second item</li>
<li class="list-item">A third item</li>
</ul>
</div>
Combine lists with card headers.
<div class="card">
<div class="card-header">Header text</div>
<ul class="list list-divider">
<li class="list-item">An item</li>
<li class="list-item">A second item</li>
<li class="list-item">A third item</li>
</ul>
</div>
Add footers to provide additional context or actions for list content.
<div class="card">
<ul class="list list-divider">
<li class="list-item">An item</li>
<li class="list-item">A second item</li>
<li class="list-item">A third item</li>
</ul>
<div class="card-footer">Card footer</div>
</div>
Cards assume no specific width to start, so they’ll be 100% wide unless otherwise stated. You can change this as needed with custom CSS, grid classes or utilities.
Card layouts¶
Element provides different container patterns to organize and manage multiple cards effectively:
- Card groups - Connected cards with equal dimensions
- Grid cards - Flexible grid-based card arrangements
Card groups create cohesive card layouts where cards are connected and maintain equal dimensions. Ideal for showcasing related content side-by-side. All cards automatically match the height of the tallest card.
<div class="card-group">
<div class="card">
<div class="card-body">
<p class="card-text">
This is a wider card with supporting text below as a natural lead-in to additional content.
This content is a little bit longer.
</p>
</div>
</div>
<div class="card">
<div class="card-body">
<p class="card-text">
This card has supporting text below as a natural lead-in to additional content.
</p>
</div>
</div>
</div>
When card groups include footers, they automatically align at the bottom regardless of content height differences.
<div class="card-group">
<div class="card">
<div class="card-body">
<p class="card-text">
This is a wider card with supporting text below as a natural lead-in to additional content.
This content is a little bit longer.
</p>
</div>
<div class="card-footer">
<small class="text-disabled">Last updated 3 mins ago</small>
</div>
</div>
<div class="card">
<div class="card-body">
<p class="card-text">
This card has supporting text below as a natural lead-in to additional content.
</p>
</div>
<div class="card-footer">
<small class="text-disabled">Last updated 3 mins ago</small>
</div>
</div>
</div>
Use the grid system to create responsive card layouts. Wrap cards in columns and rows to control their positioning and spacing.
For example, here’s .row-cols-1 laying out the cards on one column, and .row-cols-md-2 splitting four cards to equal width across multiple rows, from the medium breakpoint up.
<div class="row row-cols-1 row-cols-md-2 g-4">
<div class="col">
<div class="card">
<div class="card-body">
<p class="card-text">
This is a longer card with supporting text below as a natural lead-in to additional
content. This content is a little bit longer.
</p>
</div>
</div>
</div>
<div class="col">
<div class="card">
<div class="card-body">
<p class="card-text">
This is a longer card with supporting text below as a natural lead-in to additional
content. This content is a little bit longer.
</p>
</div>
</div>
</div>
<div class="col">
<div class="card">
<div class="card-body">
<p class="card-text">
This is a longer card with supporting text below as a natural lead-in to additional
content.
</p>
</div>
</div>
</div>
<div class="col">
<div class="card">
<div class="card-body">
<p class="card-text">
This is a longer card with supporting text below as a natural lead-in to additional
content. This content is a little bit longer.
</p>
</div>
</div>
</div>
</div>
Types Documentation¶
ContentActionBarMainItem
( MenuItemAction | MenuItemCheckbox | MenuItemLink | MenuItemRouterLink | MenuItemGroup ) & { iconOnly?: boolean } ¶
The MenuItem is used to configure clickable items in menus. They support a name, link, icons and sub-menu items. Deprecated: This interface should no longer be used. Use a corresponding alternative based on your use case: • for SiMenuFactoryComponent use @siemens/element-ng/menu#MenuItem • for SiContentActionBarComponent use @siemens/element-ng/menu#MenuItem and ContentActionBarMainItem • for SiNavbarVerticalComponent use NavbarVerticalItem • for @siemens/dashboards-ng#SiFlexibleDashboardComponent use @siemens/dashboards-ng#DashboardToolbarItem A function that will be invoked when clicking on the menu item. When passed as a string, use together with SiLinkActionService to receive events. This is meant for repetitive things in lists/tables/etc. action ? : Defines the content of the optional badge. Should be a number or something like "100+". if undefined or empty string, no badge is displayed Defines the background color of the badge. Default is specific to Element flavour. badgeColor ? : Show a dot badge without content? Defines the badge style badgeStyle ? : Defines if custom content is chosen in account dropdown (otherwise accountItems are used) customContent ? : A boolean that lets the link know whether it is disabled or not. Whether the menu items sub-menu should open upwards instead of downwards. dropUpwards ? : If the menu item has children you can specify if they are visible or not. Defines a href URI that the menu item will be linked to. Will be used to set the href attribute of the a element. Will only be used if link and function is not set. The web font icon class name (e.g. element-settings-outline). Defines if only the icon is shown in the default navigation bar. An optional id to uniquely identify the menu item. The value for an image src tag. Maybe a relative or absolute link to an jpg or gif image. A boolean that lets the link know whether it is active or not. It is useful when action() is executed instead of link route. Whether the menu item should be displayed as a heading/title, will also disable links and actions. A navigation bar item can have a sub-menu, if these items are set. They define the sub-menu content. Defines the link of the menu item within the application using the angular router link concept. Accepts an array of For single/multi choice items: the kind of icon to show. selectionState ? : The target attribute specifies where to open the linked document. If no target is specified, the link will open in the current tab. The title of the menu item. Can be either the title to be displayed or the translation key. title ? : The optional tooltip of the link. Can be either the text to be displayed or the translation key. tooltip ? : Type to distinguish between check and radio menu items. Needs to be set for correct interaction and used for a11y.
string | ((param?: any) => void | any) Inherited from Link ¶ string ¶ "" | "inline" | "dot" ¶ boolean ¶ boolean ¶ any as per [routerLink API definition]https://angular.dev/api/router/RouterLink."" | "check" | "radio" ¶ TranslatableString Inherited from Link ¶ TranslatableString Inherited from Link ¶
Represents a translatable string. This can either be a translation key, e.g. ACTIONS.EDIT that will be automatically translated when displayed on the UI or a pre-translated string, e.g. Edit. Equivalent to a normal string in usage and functionality.
A function that will be invoked when clicking on the menu item. When passed as a string, use together with SiLinkActionService to receive events. This is meant for repetitive things in lists/tables/etc. A boolean that lets the link know whether it is disabled or not. Defines a href URI that the menu item will be linked to. Will be used to set the href attribute of the a element. Will only be used if link and function is not set. A boolean that lets the link know whether it is active or not. It is useful when action() is executed instead of link route. Defines the link of the menu item within the application using the angular router link concept. Accepts an array of The target attribute specifies where to open the linked document. If no target is specified, the link will open in the current tab. The title of the menu item. Can be either the title to be displayed or the translation key. title ? : The optional tooltip of the link. Can be either the text to be displayed or the translation key.
any as per [routerLink API definition]https://angular.dev/api/router/RouterLink.TranslatableString ¶
Action that called when the item is triggered. A function will be called, a string will be dispatched to the SiMenuActionService. action : Badge that is rendered after the label. badge ? : Color of the badge (not iconBadge). badgeColor ? : Whether the menu item id disabled. disabled ? : Optional icon that will be rendered before the label. icon ? : Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered. iconBadge ? : ID that will be attached to the DOM node. id ? : Label that is shown to the user. label :
string | ((actionParam: any, source: MenuItemAction) => void) ¶ string | number Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ boolean Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ string | number | boolean Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ TranslatableString Inherited from MenuItemBase ¶
Action that called when the item is triggered. A function will be called, a string will be dispatched to the SiMenuActionService. action : Badge that is rendered after the label. badge ? : Color of the badge (not iconBadge). badgeColor ? : Whether the checkbox is checked. Whether the menu item id disabled. disabled ? : Optional icon that will be rendered before the label. icon ? : Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered. iconBadge ? : ID that will be attached to the DOM node. id ? : Label that is shown to the user. label :
string | ((actionParam: any, source: MenuItemCheckbox) => void) ¶ string | number Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ boolean Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ string | number | boolean Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ TranslatableString Inherited from MenuItemBase ¶
Badge that is rendered after the label. badge ? : Color of the badge (not iconBadge). badgeColor ? : Whether the menu item id disabled. disabled ? : The href property of the anchor. Optional icon that will be rendered before the label. icon ? : Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered. iconBadge ? : ID that will be attached to the DOM node. id ? : Label that is shown to the user. label : The target property of the anchor.
string | number Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ boolean Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ string | number | boolean Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ TranslatableString Inherited from MenuItemBase ¶
Represents a menu item that navigates using the Angular Router. Requires a configured Angular Router. Badge that is rendered after the label. badge ? : Color of the badge (not iconBadge). badgeColor ? : Whether the menu item id disabled. disabled ? : Navigation extras that are passed to the RouterLink. extras ? : Optional icon that will be rendered before the label. icon ? : Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered. iconBadge ? : ID that will be attached to the DOM node. id ? : Label that is shown to the user. label : Link for the angular router. Accepts the same values as RouterLink. routerLink :
string | number Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ boolean Inherited from MenuItemBase ¶ NavigationExtras ¶ string Inherited from MenuItemBase ¶ string | number | boolean Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ TranslatableString Inherited from MenuItemBase ¶ string | any[] ¶
Badge that is rendered after the label. badge ? : Color of the badge (not iconBadge). badgeColor ? : Submenu items for this menu item. Whether the menu item id disabled. disabled ? : Optional icon that will be rendered before the label. icon ? : Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered. iconBadge ? : ID that will be attached to the DOM node. id ? : Label that is shown to the user. label :
string | number Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ boolean Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ string | number | boolean Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ TranslatableString Inherited from MenuItemBase ¶
Items that are part of the radio group. children :
[MenuItemHeader, ...(MenuItemRadio | MenuItemHeader | MenuDivider)[]] ¶
Action that called when the item is triggered. A function will be called, a string will be dispatched to the SiMenuActionService. action : Badge that is rendered after the label. badge ? : Color of the badge (not iconBadge). badgeColor ? : Whether the radio is checked. Whether the menu item id disabled. disabled ? : Optional icon that will be rendered before the label. icon ? : Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered. iconBadge ? : ID that will be attached to the DOM node. id ? : Label that is shown to the user. label :
string | ((actionParam: any, source: MenuItemRadio) => void) ¶ string | number Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ boolean Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ string | number | boolean Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ TranslatableString Inherited from MenuItemBase ¶
Badge that is rendered after the label. Color of the badge (not iconBadge). badgeColor ? : Whether the menu item id disabled. Optional icon that will be rendered before the label. Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered. ID that will be attached to the DOM node. Label that is shown to the user.
string ¶
Except where otherwise noted, content on this site is licensed under MIT License.