Skip to content
Last updated

CarouselCardList Pattern

A horizontal scrolling carousel pattern that displays CardOffgrid components with navigation buttons. Features responsive sizing, smooth scrolling, and full dark/light mode theming support.

Features

  • Horizontal scrolling card carousel with navigation buttons
  • Automatic button enable/disable based on scroll position
  • Two color variants: neutral and green (inherited by cards and buttons)
  • Responsive card sizing across mobile, tablet, and desktop breakpoints
  • Full dark mode and light mode support
  • Heading and description constrained to page grid
  • Hidden scrollbar with smooth scroll behavior
  • Keyboard navigation and accessibility support

Usage

import { CarouselCardList } from 'shared/sections/CarouselCardList';

<CarouselCardList
  variant="neutral"
  heading="Why Build on the XRP Ledger"
  description="Discover the unique features that make XRPL ideal for your project."
  cards={[
    {
      icon: <TokenIcon />,
      title: "Native\nTokenization",
      description: "Issue and manage digital assets directly on the ledger.",
      href: "/docs/tokenization",
    },
    {
      icon: <WalletIcon />,
      title: "Low Cost\nTransactions",
      description: "Transaction costs are a fraction of a cent.",
      href: "/docs/fees",
    },
    // ... more cards
  ]}
/>

Props

CarouselCardListProps

PropTypeRequiredDefaultDescription
variant'neutral' | 'green'No'neutral'Color variant for cards and navigation buttons
headingReactNodeYes-Section heading text
descriptionReactNodeYes-Section description text
cardsCarouselCardConfig[]Yes-Array of card configurations
classNamestringNo-Additional CSS classes for the section

CarouselCardConfig

Each card in the cards array accepts the following properties (same as CardOffgridProps, excluding variant):

PropTypeRequiredDescription
iconReactNode | stringYesIcon component or image URL
titlestringYesCard title (use \n for line breaks)
descriptionstringYesCard description text
hrefstringNoLink destination URL
onClick() => voidNoClick handler function
disabledbooleanNoDisabled state
classNamestringNoAdditional CSS classes

Variants

Neutral Variant

The default variant using gray color palette. Best for general purpose content sections.

<CarouselCardList
  variant="neutral"
  heading="Platform Features"
  description="Explore what makes our platform unique."
  cards={cards}
/>

Green Variant

Uses the brand green color palette. Best for featured or highlighted sections.

<CarouselCardList
  variant="green"
  heading="Enterprise Solutions"
  description="Purpose-built for institutional adoption."
  cards={cards}
/>

Responsive Behavior

BreakpointCard WidthCard HeightCard PaddingButton Size
Mobile (< 576px)343px400px16px37px
Tablet (576px - 991px)356px440px20px37px
Desktop (≥ 992px)400px480px24px40px

Spacing Tokens

TokenMobileTabletDesktop
Header gap8px8px16px
Section gap24px32px40px
Cards gap8px8px8px

Accessibility

  • Navigation buttons have descriptive aria-label attributes ("Previous cards", "Next cards")
  • Carousel track has role="region" with aria-label="Card carousel"
  • Keyboard navigation supported via Tab and arrow keys
  • Focus ring visible on keyboard navigation (uses focus-visible)
  • Disabled buttons properly convey state via disabled attribute and visual styling
  • Cards support keyboard interaction (Tab, Enter, Space)

Design Tokens

Colors (Dark Mode - Default)

Neutral Variant:

  • Button Enabled: $gray-300 (#CAD4DF)
  • Button Hover: $gray-400 (#8A919A)
  • Button Disabled: $gray-500 @ 50% opacity

Green Variant:

  • Button Enabled: $green-300 (#21E46B)
  • Button Hover: $green-200 (#70EE97)
  • Button Disabled: $green-100 (#ACFFC5)

Colors (Light Mode - html.light)

Neutral Variant:

  • Button Enabled: $gray-300 (#CAD4DF)
  • Button Hover: $gray-400 (#8A919A)
  • Button Disabled: $gray-100 (#F0F3F7)

Green Variant:

  • Button Enabled: $green-300 (#21E46B)
  • Button Hover: $green-200 (#70EE97)
  • Button Disabled: $green-100 (#ACFFC5)

CSS Classes

ClassDescription
.bds-carousel-card-listBase section container
.bds-carousel-card-list--neutralNeutral color variant
.bds-carousel-card-list--greenGreen color variant
.bds-carousel-card-list__headerHeader wrapper (title, subtitle, nav)
.bds-carousel-card-list__header-contentTitle and subtitle wrapper
.bds-carousel-card-list__headingSection heading (uses .h-md)
.bds-carousel-card-list__descriptionSection description (uses .body-l)
.bds-carousel-card-list__navNavigation buttons wrapper
.bds-carousel-card-list__buttonNavigation button
.bds-carousel-card-list__button--prevPrevious button modifier
.bds-carousel-card-list__button--disabledDisabled button modifier
.bds-carousel-card-list__track-wrapperScroll container wrapper
.bds-carousel-card-list__trackHorizontal scroll track
.bds-carousel-card-list__cardIndividual card wrapper

Showcase

View the pattern showcase at: /about/carousel-card-list-showcase

Design References