Staaarter

Markdown Code Block

A terminal-style code block rendering each question as a ## markdown heading in monospace type, followed by its answer as plain text, mimicking how a FAQ would read inside a project's README or docs file.

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/markdown-code-block.json

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

Usage

The file also exports faq40Demo, 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 { Faq40, faq40Demo } from "@/components/blocks/faq/faq40";

export default function Page() {
  return <Faq40 {...faq40Demo} />;
}

Props

PropTypeDefaultDescription
fileNamestring"FAQ.md"File name shown in the mock window header.
headingstringnoneOptional section heading above the code block.
descriptionstringnoneOptional supporting copy under the heading.
itemsDocFaqItem[]noneList of questions and answers rendered as markdown-style entries.
classNamestringnoneExtra classes for the outer section element.

Types

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

Behavior notes

  • Plain server component; no real markdown parsing happens, the ## prefix and monospace styling are purely visual to evoke a docs file.
  • The dark bg-neutral-950 palette is a deliberate one-off exception to the site's semantic-token rule, used here specifically for the terminal/code aesthetic the brief calls for.
  • The three header dots are decorative window-chrome only, not real window controls, and the content area scrolls independently once it exceeds its max height.