Please refer to #3446052: [later phase] Create components for a default design system

Card component definition

A card is a flexible and extensible content container. It includes options for headers and footers, a wide variety of content, contextual background colors, and powerful display options. If you’re familiar with Bootstrap 3, cards replace our old panels, wells, and thumbnails. Similar functionality to those components is available as modifier classes for cards.

Variants

Sample Card Variants

Markup (TBD)

<div class="card" style="width: 18rem;">
  <img class="card-img-top" src="..." alt="Card image cap">
  <div class="card-body">
    <span class="card-eyebrow">New!</h5>
    <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>

Discussion and talking points

Schema

Should SDCs morph dynamically based on data?

Example: Put as many optional "fields" where data can be printed if present, but these won't break the layout if any are missing.

Nesting components

Scenario: A call to action can look like a link, can be underlined or not, can look like a button, can have an icon, etc.

Does SDC support nesting other components?

CommentFileSizeAuthor
#3 Card Variants.png193.11 KBrmontero

Comments

rmontero created an issue. See original summary.

rmontero’s picture

Issue summary: View changes
rmontero’s picture

Issue summary: View changes
StatusFileSize
new193.11 KB
finnsky’s picture

Card presented as SDC in Umami
https://git.drupalcode.org/project/drupal/-/tree/11.x/core/profiles/demo...
It is fully BEM powered and uses slots.

larowlan’s picture

These should support both manually entered fields but also drawing fields from a node where the link, title, teaser etc is centrally managed

lauriii’s picture

wim leers’s picture

Title: Card component (Default component library for the experience builder) » [later phase] Card component (Default component library for the experience builder)
Component: Code » Theme builder
Assigned: rmontero » Unassigned
Status: Active » Postponed
Related issues: +#3450621: [later phase] Theme Builder vision

#3446722: Introduce an example set of representative SDC components; transition from "component list" to "component tree" will get us to a point where we have sufficiently diverse components (at least for now).

This issue is still relevant; we can keep it(s discussion) around for when we work on the actual default design system, which is for the Theme Builder, which is happening at a later time — see #3450621-6: [later phase] Theme Builder vision.

kristen pol’s picture

Issue summary: View changes

Fixed typo in summary and made minor formatting updates.

Project: Experience Builder » Drupal Canvas
Version: » 1.x-dev

Experience Builder has been renamed to Drupal Canvas in preparation for its beta release. You can now track issues on the new project page.

balintbrews’s picture

Status: Postponed » Closed (outdated)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.