Stacked Card Flip
A vertical stack of FAQ cards that overlap with slight negative margins and alternating tilt in their resting state, suggesting a physical stack of index cards. Clicking a card straightens it and expands it in place to reveal its answer.
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/stacked-card-flip.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/faq/faq65.tsx instead.
Usage
The file also exports faq65Demo, 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 { Faq65, faq65Demo } from "@/components/blocks/faq/faq65"; export default function Page() { return <Faq65 {...faq65Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| badge | string | none | Small eyebrow label above the heading. |
| heading | string | none | Section heading. |
| description | string | none | Section intro text. |
| items | FaqItem[] | none | Questions rendered as cards in the stack. |
| className | string | none | Extra classes for the outer section element. |
Types
type FaqItem = { question: string; answer: string; };
Behavior notes
- "use client" because each card is a real accordion holding local open-index state, only one card open at a time.
- The stack metaphor comes entirely from resting-state styling: cards overlap via negative top margin and each carries a small fixed rotation cycled from a 6-value array by index, not Math.random(), so the layout is stable across server and client renders.
- Clicking a card removes its rotation, raises its stacking order (z-index) above the rest, and expands its answer inline; later cards in the stack are pushed down by normal document flow rather than by an animated push effect.
More FAQ Blocks
View all →collapsible-accordion
Collapsible Accordion
Stacked cards with expandable sections, for full-length answers in a compact format.
open-list-layout
Open List Layout
Questions with answers displayed directly below in a simple always-open list.
three-column-grid
Three Column Grid
Q&A pairs arranged in a responsive grid layout, always open.
tabbed-categories
Tabbed Categories
Sidebar navigation with category tabs and an accordion of that category's questions.
searchable-accordion
Searchable Accordion
Search input that filters accordion items in real-time by question and answer text.
grouped-sections
Grouped Sections
FAQs organized into titled sections, each with its own independent accordion below it.