Staaarter

Horizontal Scroll Cards

A row of fixed-width FAQ cards that scrolls horizontally using native browser scrolling, with soft gradient overlays fading the left and right edges so the scrollable area reads clearly without needing any JavaScript.

By Staaarter Team
FAQ
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/horizontal-scroll-cards.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/faq/faq23.tsx instead.

Usage

The file also exports faq23Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Faq23, faq23Demo } from "@/components/blocks/faq/faq23";

export default function Page() {
  return <Faq23 {...faq23Demo} />;
}

Props

PropTypeDefaultDescription
badgestringnoneSmall label shown above the heading.
headingstringnoneSection heading.
descriptionstringnoneSupporting copy under the heading.
faqsFaqItem[]noneList of question/answer pairs rendered as scrollable cards.
classNamestringnoneExtra classes for the outer section element.

Types

interface FaqItem {
  question: string;
  answer: string;
}

Behavior notes

  • Scrolling is native browser horizontal scroll (overflow-x-auto), there is no JavaScript-driven scroll logic.
  • The left and right fade effects are decorative, absolutely-positioned gradient overlays with pointer-events disabled, they do not respond to scroll position.
  • This is a plain server component, all cards render server-side with no client state.