FAQ Pro

Searchable FAQ with auto-expanded matches and query highlights.

Installation

npx shadcn@latest add @iconiq/faq-pro

File Structure

Usage

"use client";

import { FaqPro, type FaqProItem } from "@/components/ui/faq-pro";

const items: FaqProItem[] = [
  {
    id: "what-is-iconiq",
    question: "What is Iconiq?",
    answer: "Iconiq is an open-source library of motion-powered React components built around the shadcn registry workflow. Browse polished UI primitives, install them as local files, and adapt them inside your own codebase.",
    keywords: ["about", "overview", "library"],
  },
  {
    id: "install-iconiq",
    question: "How do I install an Iconiq component?",
    answer: "Install components with shadcn using commands like npx shadcn@latest add @iconiq/b-button, or use a direct registry URL from iconiqui.com/r/b-button.json.",
    keywords: ["setup", "shadcn", "registry", "cli"],
  },
  {
    id: "iconiq-free",
    question: "Is Iconiq free to use?",
    answer: "Yes. Iconiq is open source and free to use for personal and commercial projects.",
    keywords: ["pricing", "license", "cost"],
  },
  {
    id: "iconiq-support",
    question: "Where can I get help?",
    answer: "Open an issue on GitHub or start a discussion. Community support is available for setup, theming, and customization questions.",
    keywords: ["help", "contact", "community"],
  }
];

export function FaqProPreview() {
  return (
    <FaqPro
      className="w-full"
      defaultOpenFirst
      items={items}
    />
  );
}

Props

Props
Description

FaqPro

items

Array of `{ id, question, answer, keywords?, disabled? }` entries. `answer` accepts ReactNode (string answers get highlighted and searched). Each id must be unique.

Type FaqProItem[]

value

Controlled open item id. Pair with onOpenChange. Use null to close all.

Type string | null

onOpenChange

Called whenever the open item changes, in both controlled and uncontrolled modes.

Type (openId: string | null) => void

defaultValue

Initial open item id for uncontrolled usage. Overrides defaultOpenId and defaultOpenFirst.

Type string | null

defaultOpenId

Opens a specific item id by default when there is no active query.

Type string

defaultOpenFirst

Opens the first enabled item when there is no active search query.

Type boolean·Default false

hideSearch

Hides the search field and renders the list only.

Type boolean·Default false

filter

Custom match predicate. Overrides the built-in multi-term substring search.

Type (item: FaqProItem, query: string) => boolean

onQueryChange

Called whenever the search query changes.

Type (query: string) => void

searchPlaceholder

Placeholder and accessible label for the search field.

Type string·Default Search FAQs...

emptyMessage

Message shown when there are no items at all.

Type string·Default No FAQs to show yet.

noResultsMessage

Message shown when a query returns no matches.

Type string·Default No FAQs match your search.

themed

Applies the built-in light/dark token surface. Set false to inherit your app tokens.

Type boolean·Default true

className

Optional class names applied to the root container.

Type string

Registry bundle

Install the exact registry entry shown on the right when you want the component file and its declared runtime dependencies together.

Dependencies: @base-ui/react/accordion, motion, lucide-react.

This page documents the Base UI install only. FAQ Pro uses Base UI Accordion for single-open FAQ rows.

The generated registry file is /r/faq-pro.json.

Contact

Additionally, if you find any bug or issue, feel free to raise an issue.

Iconiq is an open-source library of motion-powered React components built around the shadcn registry workflow. Browse polished UI primitives, install them as local files, and adapt them inside your own codebase.