Staaarter

Icon Grid Cards

A grid of FAQ cards, each with a lucide-react icon in a rounded tinted tile, a short question as the title, and a short answer below. Icons are assigned by position from a fixed set, so the block stays a plain server component.

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 dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/icon-grid-cards.json

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

Usage

The file also exports faq21Demo, 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 { Faq21, faq21Demo } from "@/components/blocks/faq/faq21";

export default function Page() {
  return <Faq21 {...faq21Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Frequently asked questions"Section heading.
descriptionstring"Everything you need to know..."Supporting copy under the heading.
itemsFaqItem[]noneQuestion and answer pairs rendered as cards.
classNamestringnoneExtra classes for the outer section element.

Types

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

Behavior notes

  • Purely presentational, there is no expand/collapse, every card's answer is always visible.
  • Icons come from a fixed lucide-react array indexed by the item's position in the list, not from a prop, since a component reference can't be passed through this block's props.
  • If more items are passed than there are icons in the fixed array, icons repeat by cycling through the array with modulo.