Searchable FAQ with auto-expanded matches and query highlights.
npx shadcn@latest add @iconiq/faq-pro"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}
/>
);
}itemsArray of `{ id, question, answer, keywords?, disabled? }` entries. `answer` accepts ReactNode (string answers get highlighted and searched). Each id must be unique.
Type FaqProItem[]
valueControlled open item id. Pair with onOpenChange. Use null to close all.
Type string | null
onOpenChangeCalled whenever the open item changes, in both controlled and uncontrolled modes.
Type (openId: string | null) => void
defaultValueInitial open item id for uncontrolled usage. Overrides defaultOpenId and defaultOpenFirst.
Type string | null
defaultOpenIdOpens a specific item id by default when there is no active query.
Type string
defaultOpenFirstOpens the first enabled item when there is no active search query.
Type boolean·Default false
hideSearchHides the search field and renders the list only.
Type boolean·Default false
filterCustom match predicate. Overrides the built-in multi-term substring search.
Type (item: FaqProItem, query: string) => boolean
onQueryChangeCalled whenever the search query changes.
Type (query: string) => void
searchPlaceholderPlaceholder and accessible label for the search field.
Type string·Default Search FAQs...
emptyMessageMessage shown when there are no items at all.
Type string·Default No FAQs to show yet.
noResultsMessageMessage shown when a query returns no matches.
Type string·Default No FAQs match your search.
themedApplies the built-in light/dark token surface. Set false to inherit your app tokens.
Type boolean·Default true
classNameOptional class names applied to the root container.
Type string
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.