Contact Us

SectionCard

DOC-00066 reference implementor, developer

Overview

SectionCard is a CORE-OWNED composition building block in src/core/components/sections/SectionCard.astro. It renders a single card with heading, body text, optional media, badge, icon, and action links. It is not used directly in page content — section components like InfoCards and FeatureGrid consume it by passing card data arrays.

Props

PropTypeDefaultDescription
titlestringrequiredCard heading text
bodystringrequiredCard body text
badgestringSmall label rendered below the heading
iconstringEmoji or text icon rendered before the heading
mediaSectionMediaImage object with src and alt properties
orientation"vertical" | "horizontal""vertical"Card layout direction
linksSectionCardLink[][]Action links, each with href, label, and optional external flag
fullCardClickbooleantrueEnable full-card click area when a single link is present
itemFullCardClickbooleanPer-item override of fullCardClick, passed from the parent section component
titleLinkbooleanfalseWhen true, the primary link wraps the title instead of appearing as a separate link in the body
cardBackgroundSectionBackground"soft"Card surface variant: default, soft, strong, contrast, inverted, primary, secondary, tertiary
headingLevel163Semantic heading level
headingSizexsdisplay"xl"Visual heading size (decoupled from semantic level)
classstringAdditional CSS classes

Behavior

Full-card click

When fullCardClick is true and the card has exactly one link, the entire card surface becomes clickable. This is implemented via a ::after pseudo-element overlay positioned over the card. The link remains accessible through the heading text, so keyboard and screen reader users interact with a standard link element.

When itemFullCardClick is provided, it overrides the fullCardClick default for that specific card instance — this allows parent section components to control the behavior per item.

Orientation

  • Vertical (default): Media stacks above content.
  • Horizontal: At narrow viewports, cards stack vertically. At 48rem and above, media and content display side-by-side with media taking approximately 40% of the card width.

Background variants

Each cardBackground variant applies a .surface--bg-* class that remaps --st-color-link and --st-color-link-hover tokens. This ensures link colors remain accessible on every surface — inverted surfaces get light link colors, brand surfaces get appropriately contrasting link colors, and so on.

When titleLink is true, the primary link wraps the heading text directly rather than appearing as a standalone link in the card body. This is useful for cards where the heading itself should be the click target.

Heading

SectionCard uses the Heading component (not raw <h> tags), so heading level and visual size are always decoupled correctly.

CSS API

BEM root class: section-card

ClassElement
.section-cardCard root
.section-card__mediaMedia container (image wrapper)
.section-card__contentContent area (heading + body)
.section-card__titleHeading wrapper
.section-card__bodyBody text
.section-card__linksAction links container
.section-card__primary-linkPrimary action link

These classes are available as CSS API hooks for site-level overrides in src/site/styles/.

Usage

SectionCard is an internal primitive — it is not imported directly in page content. Section components like InfoCards and FeatureGrid pass arrays of card data objects, and each item is rendered as a SectionCard.

Note: To customize card appearance at the site level, target the BEM classes above in site-owned stylesheets rather than modifying the core component.

Search

Search across pages and articles. Use arrow keys to navigate results.

Search across pages and articles.

Loading search...

Search is unavailable. Please try again later.

    No results for ""

    Try different keywords or fewer words.