Contact Us

InfoCards

DOC-00101 reference implementor, developer

Overview

InfoCards is a CORE-OWNED section component in src/core/components/sections/InfoCards.astro. It renders a grid of cards from a structured data array, with each card delegated to SectionCard. Cards support badges, media, and action links.

InfoCards and FeatureGrid share the same architecture. The only difference is that FeatureGrid items support an icon field while InfoCards items do not. Use InfoCards for standard content cards; use FeatureGrid when cards benefit from a visual icon prefix.

Props

PropTypeDefaultDescription
columns2 | 33Number of grid columns (responsive auto-fit)
cardOrientation"vertical" | "horizontal""vertical"Card layout direction (passed to SectionCard)
fullCardClickbooleantrueEnable full-card click area for single-link cards
cardBackgroundSectionBackgroundDefault card surface variant (overridable per item)
itemsInfoCardItem[]requiredArray of card data objects (see Items below)
classstringAdditional CSS classes

All other HTML attributes (id, aria-*, data-*, etc.) are forwarded to the root <div> via attribute passthrough.

Items

Each item in the items array has this shape:

FieldTypeDescription
titlestringCard heading text
bodystringCard body text
badgestringSmall label below the heading
mediaSectionMediaImage with src and alt
linksSectionCardLink[]Action links with href, label, and optional external
fullCardClickbooleanPer-item override of the section-level fullCardClick
cardBackgroundSectionBackgroundPer-item override of the section-level cardBackground

Behavior

Column layout

The grid uses CSS auto-fit with minimum column widths:

  • 2 columns: minmax(min(100%, 24rem), 1fr) — cards fill two columns on wide viewports, collapse to one on narrow
  • 3 columns: minmax(min(100%, 20rem), 1fr) — same pattern with a smaller minimum

Card delegation

Each item is rendered as a SectionCard. All card behavior (full-card click, orientation, background variants, title link) is inherited from SectionCard. See the SectionCard reference for details.

Heading composition

InfoCards does not render its own heading. Callers compose headings as siblings before the component, inside the same LayoutSection:

  • Visible heading: Place a <Heading> before <InfoCards> inside the same LayoutSection
  • Screen-reader-only naming: Use the LayoutSection label prop to set aria-label on the wrapping <section>

CSS API

BEM root class: info-cards

ClassElement
.info-cardsComponent root (<div>)
.info-cards__gridGrid container (<ul>)
.info-cards__itemGrid item (<li>)

Modifier classes applied automatically:

ModifierApplied when
.info-cards__grid--2columns={2}
.info-cards__grid--3columns={3}

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

Usage

<LayoutSection>
  <Heading level={2}>Latest Updates</Heading>
  <InfoCards
    items={[
      {
        title: "New Feature",
        body: "We shipped a new feature this week.",
        badge: "New",
        links: [{ href: "/articles/new-feature/", label: "Read more" }],
      },
      {
        title: "Case Study",
        body: "How our client improved performance by 40%.",
        media: { src: "/images/case-study.jpg", alt: "Case study" },
        links: [{ href: "/articles/case-study/", label: "Read more" }],
      },
    ]}
    columns={2}
    cardOrientation="horizontal"
  />
</LayoutSection>

Note: To customize InfoCards appearance at the site level, target the BEM classes above in site-owned stylesheets rather than modifying the core component. Card-level styling is controlled via SectionCard’s CSS API.

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.