Staaarter

Slide-Out Panels

An accordion-style FAQ where each answer slides open with a smooth height transition rather than snapping open, with a hairline bottom border separating each question.

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/slide-out-panels.json

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

Usage

The file also exports faq39Demo, 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 { Faq39, faq39Demo } from "@/components/blocks/faq/faq39";

export default function Page() {
  return <Faq39 {...faq39Demo} />;
}

Props

PropTypeDefaultDescription
badgestringnoneSmall label shown above the heading.
headingstringnoneSection heading.
descriptionstringnoneSupporting copy under the heading.
itemsSlidePanelItem[]noneList of questions and answers.
classNamestringnoneExtra classes for the outer section element.

Types

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

Behavior notes

  • "use client" because a single question is expanded at a time in local state, toggled by a real aria-expanded button.
  • The slide animation uses the CSS grid-template-rows 0fr/1fr trick (transition-[grid-template-rows] on a grid wrapper with an overflow-hidden inner div) instead of toggling display or height:auto, so the reveal actually animates smoothly.
  • Each row keeps a border-b border-border separator regardless of open state, matching the bottom-border-separator brief.