Staaarter

Info Icon Tooltips

A dense FAQ list where each question sits next to a small info icon button. Hovering or focusing that icon reveals the answer in an absolutely-positioned tooltip panel beneath the row, keeping the resting layout extremely compact while still making every answer reachable by keyboard.

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/info-icon-tooltips.json

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

Usage

The file also exports faq48Demo, 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 { Faq48, faq48Demo } from "@/components/blocks/faq/faq48";

export default function Page() {
  return <Faq48 {...faq48Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Frequently asked questions"Section heading.
descriptionstringnoneOptional supporting copy under the heading.
faqsFaqTooltipItem[]noneList of question/answer pairs, one info icon per row.
classNamestringnoneExtra classes for the outer section element.

Types

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

Behavior notes

  • Real client behavior: an openIndex state tracks which row's info button is currently hovered or keyboard-focused, and only that row's tooltip renders.
  • The tooltip button uses onMouseEnter/onMouseLeave and onFocus/onBlur together so the answer is reachable both by mouse and by keyboard, with aria-expanded reflecting the open state.