Skip to main content
Neighborhood Design System v5.1.0

Card List

Ready

Collection of card items that can contain a brief description, an image, and a call to action.

Preview

Open in Storybook (opens in new tab)

Code

Install
npm install @fbin-web/neighborhood-core
Import
import { NbhdCardList } from '@fbin-web/neighborhood-core';
Usage
<nbhd-card-list size="small">
  <nbhd-text
    slot="eyebrow"
    tag="div"
    variant="eyebrow">
    Fermentum Pellentesque Malesuada
  </nbhd-text>
  <nbhd-text
    slot="title"
    tag="h2"
    variant="title">
    Neighborhood Cards
  </nbhd-text>
  <nbhd-text
    slot="subtitle"
    tag="h3"
    variant="subtitle">
    Tortor Pellentesque
  </nbhd-text>
  <nbhd-text
    slot="content"
    tag="div">
    Curabitur blandit tempus porttitor.
  </nbhd-text>
  <nbhd-cta
    slot="cta"
    variant="tertiary"
    href="fun-cta-cards"
    aria-label="Learn more about CARDS"
    cssclass="cta-tracking-mtr-42">
    Main CTA
  </nbhd-cta>

  <nbhd-card surface="secondary">
    <nbhd-image
      slot="media"
      provider="widen"
      src="https://moen.widen.net/content/qvmrvyj220/original/smartsprinkler-controller-app-campaignslider.jpg"
      css-class="media-css-class-card-1"
      image-focus="center">
    </nbhd-image>

    <nbhd-text
      class="card-title"
      tag="h4"
      slot="title">
      Card 1
    </nbhd-text>

    <nbhd-text
      slot="content"
      tag="div"
      >Maecenas sed diam eget risus varius blandit sit amet non magna.</nbhd-text
    >

    <nbhd-cta
      slot="cta"
      variant="tertiary"
      href="fun-cta-card-1"
      css-class="cta-tracking-mtr-card1"
      aria-label="Learn more about Card 1">
      CTA 1
    </nbhd-cta>
  </nbhd-card>

  <nbhd-card surface="secondary">
    <nbhd-image
      slot="media"
      provider="widen"
      src="https://moen.widen.net/content/qvmrvyj220/original/smartsprinkler-controller-app-campaignslider.jpg"
      css-class="media-css-class-card-2"
      image-focus="center">
    </nbhd-image>

    <nbhd-text
      class="card-title"
      tag="h4"
      slot="title">
      Card 2
    </nbhd-text>

    <nbhd-text
      slot="content"
      tag="div"
      >Maecenas sed diam eget risus varius blandit sit amet non magna.</nbhd-text
    >

    <nbhd-cta
      slot="cta"
      variant="tertiary"
      href="fun-cta-card-2"
      css-class="cta-tracking-mtr-card2"
      aria-label="Learn more about Card 2">
      CTA 2
    </nbhd-cta>
  </nbhd-card>

  <nbhd-card surface="secondary">
    <nbhd-image
      slot="media"
      provider="widen"
      src="https://moen.widen.net/content/qvmrvyj220/original/smartsprinkler-controller-app-campaignslider.jpg"
      css-class="media-css-class-card-3"
      image-focus="center">
    </nbhd-image>

    <nbhd-text
      class="card-title"
      tag="h4"
      slot="title">
      Card 3
    </nbhd-text>

    <nbhd-text
      slot="content"
      tag="div"
      >Maecenas sed diam eget risus varius blandit sit amet non magna.</nbhd-text
    >

    <nbhd-cta
      slot="cta"
      variant="tertiary"
      href="fun-cta-card-3"
      css-class="cta-tracking-mtr-card3"
      aria-label="Learn more about Card 3">
      CTA 3
    </nbhd-cta>
  </nbhd-card>
</nbhd-card-list>

Image Dimensions

If not providing a resized image be sure to enable cropping feature for the component properties.

DescriptionDimension
Small and Medium Card Item Landscape238px x 160px
Small and Medium Card Item Portrait160px x 238px
Small and Medium Card Item Square238px x 238px
Large and XLarge Card Item Landscape445px x 300px
Large and XLarge Card Item Portrait300px x 445px
Large and XLarge Card Item Square445px x 445px

Properties

PropertyAttributeTypeDefaultDescription
introAlignmentintro-alignmentstartcenterendcenterAligns the intro content inside the card list intro container.
compactcompactbooleanfalseApplies the compact layout treatment to the intro section.
surfaceScopesurface-scopecomponentintrocomponentDetermines whether the surface styling is applied to the component container or the intro region when an intro is present.
ctaPlacementcta-placementintrofooterintroPlaces the CTA slot in the intro section or beneath the grid as a footer action.
gridAlignmentgrid-alignmentstartcenterendcenterControls the horizontal alignment of the card grid within its container.
sizesizesmallmediumlargexlargesmallSets the card size and responsive grid density for the list.
surfacesurfacenoneprimarysecondaryinverseinverse-secondaryprimaryApplies the component surface color to the card list or intro area depending on the selected scope.
marginTopmargin-topnonesmallmediumlargenoneAdjusts the top margin above the component.
marginBottommargin-bottomnonesmallmediumlargenoneAdjusts the bottom margin below the component.
paddingToppadding-topdefaultnonesmallmediumlargedefaultAdjusts the top padding of the component or intro area.
paddingBottompadding-bottomdefaultnonesmallmediumlargedefaultAdjusts the bottom padding of the component or intro area.

Slots

NameDescription
(default)The default slot is reserved for card elements only. It accepts one card type at a time, such as nbhd-card or nbhd-product-card. Cards must be direct children of the list. Anything else, including cards inside a wrapper element and cards of a second type, is hidden. Text placed directly in the list can't be hidden and renders alongside the cards.
eyebrowOptional intro eyebrow content shown above the title when the list includes an intro section.
titleOptional intro title content shown as the main heading for the card list.
subtitleOptional supporting text displayed beneath the title in the intro area.
contentOptional descriptive content shown in the intro area below the subtitle.
ctaOptional CTA content shown in the intro area or footer depending on the ctaPlacement property.

CSS Parts

NameDescription
—The root section element for the card list.
—The wrapper around the intro content area when an intro is present.
—The nbhd-container used for the intro content layout.
—The intro content block that contains the eyebrow, title, subtitle, content, and optional CTA.
—The slotted eyebrow content inside the intro area.
—The slotted title content inside the intro area.
—The slotted subtitle content inside the intro area.
—The slotted content area inside the intro area.
—The CTA slot rendered in the intro area or footer, depending on ctaPlacement.
—The container that wraps the card grid.
—The card grid container element that holds the slotted cards.
—The footer wrapper used when the CTA is rendered beneath the grid.
nbhd-card-list::part() {
  /* your styles */
}

CSS Properties

Set these on nbhd-card-list or an ancestor to override the defaults. Token is the design token a default comes from and Value is what it resolves to in core Neighborhood; brands may override them. Properties that adapt to surface follow the light or inverse surface they sit on until you set them.

PropertyTokenValue Copy
--nbhd-cardList-card-large—400px
--nbhd-cardList-card-medium—300px
--nbhd-cardList-card-small—200px
--nbhd-cardList-content-alignment—center
--nbhd-cardList-footer-paddingBlock--nbhd-space-11 --nbhd-space-044px 0px
--nbhd-cardList-footer-textAlign—center
--nbhd-cardList-grid-bpLg-gap--nbhd-space-1248px
--nbhd-cardList-grid-display—grid
--nbhd-cardList-grid-gap--nbhd-space-624px
--nbhd-cardList-grid-justifyContent—center
--nbhd-cardList-grid-max--nbhd-cardList-card-small200px
--nbhd-cardList-grid-position—relative
--nbhd-cardList-grid-zIndex--nbhd-z-11
--nbhd-cardList-host-display—block
--nbhd-cardList-intro-bpLg-offset--nbhd-space-25100px
--nbhd-cardList-intro-bpLg-paddingBlockEnd--nbhd-space-37148px
--nbhd-cardList-intro-bpMd-offset--nbhd-space-1560px
--nbhd-cardList-intro-bpMd-paddingBlockEnd--nbhd-space-25100px
--nbhd-cardList-intro-offset--nbhd-space-936px
--nbhd-cardList-intro-paddingBlockEnd--nbhd-space-1768px
--nbhd-cardList-intro-paddingBlockStart--nbhd-space-624px
--nbhd-cardList-intro-position—relative
--nbhd-cardList-marginInline--nbhd-space-00px
--nbhd-cardList-maxInlineSize—100%
--nbhd-cardList-paddingBlock--nbhd-space-624px

Dependencies

Child components <nbhd-card-list> renders internally. Import them too when you tree-shake.

Esc
↑ ↓ to move↵ to open