Card > Use cases and requirements
Purpose
Establish requirements for cards and understand how they're used in the product today.
Outcome
- Design and dev requirements.
- List of known/potential use cases.
- Ready to move to #1427 (closed) to begin the design process.
Current use
Definition: A card displays a single group of content within a set of similar groups. (Source)
Current design:
The card design is based on Bootstrap cards, that use a single container and dividers to organize content within. In the product you'll find both GitLab UI cards (GlCard .gl-card) and Bootstrap cards (.card) that haven't been migrated.
View screenshots of current card use
View screenshots of similar components and layout
| Purpose | Screenshot |
|---|---|
| MR widgets | ![]() |
| Tree content holder | ![]() |
| File holder |
![]()
|
| Info well | ![]() |
| Related items… | ![]() |
| Misc container |
![]()
|
| Tables | ![]() |
| Links | ![]() |
| Misc container | ![]() |
| Dashboard panel (WIP concept) | ![]() |
Considerations
View considerations
-
Semantics:
- List items or group of
<div>s?
- List items or group of
-
States:
- Rest
- Disabled: Based on the intent of using a card this should likely not be an option
- Hover (when entire card is linked): See additional considerations in https://inclusive-components.design/cards/
- Loading: Content within could use skeleton loader(s) instead of needing something unique to a card
- Status: Error and success
- Emphasis: Highlighted or featured
-
Sections:
- Header: Optional
- Heading level?
- Body: Required
- Any content possible including headings, so long as they follow the heading structure of the rest of the page
- Footer: Optional
- Header: Optional
-
Layout:
- Group of cards: Grid, stacked, masonry, etc.
- Within a card: Vertical or horizontal
- Responsive
-
Nesting:
- Likely no based on the purpose of a card
-
Interaction:
- Collapsible: Should this be an option?
- Drag and drop or reordering: Should this be an option?
-
Figma composing and configuration:
- What should be configurable?
- What should be composable?
- What defaults or examples should be included in the UI kit instances?
-
Appearance:
- Borders
- Border radius
- Background color
- Color on different surfaces
- Optional header and footer with optional tinted background
- Edge-to-edge internal borders separate vertical sections within
Concept and requirements
View concept direction (TBD)
Semantics
- The card design can be used for a single item (
<div>). - A set of cards should be an unordered list (
<ul>) where each card is a list item (<li>). Using a list means that a count is associated with the group so the number of items within the collection is readily available for assistive technology (AT).
Visual design and affordance
TBD
Layout
TBD
Interaction and states
TBD
Resources
Edited by Sascha Eggenberger


























