Faq
interlace-ui/faqFreeComponent
Frequently-asked-questions accordion. Composes the canonical Accordion primitive into a single-prop API: pass an array of {question, answer} and get the full disclosure pattern (keyboard, ARIA, animation) inherited from Accordion → Base UI.
Install it
npx shadcn@latest add https://ds.interlace.tools/r/faq.jsonSource
1'use client';23import * as React from 'react';45// @interlace/faq v1.0.0 — Interlace design system.6// Docs, props and live preview: https://ds.interlace.tools/c/faq7// What changed since: https://ds.interlace.tools/c/faq#history8// Generated banner — keep it, the upgrade diff reads this version.910/**11 * @interlace/ui — FAQ12 *13 * Frequently-asked-questions accordion. Composes the canonical Accordion14 * primitive into a single-prop API: pass an array of {question, answer}15 * and get the full disclosure pattern (keyboard, ARIA, animation)16 * inherited from Accordion → Base UI.17 *18 * ## Anatomy19 *20 * <section data-slot="faq" data-min-viewport="320">21 * <Container>22 * <Typography variant="h2">{title}</Typography>23 * <Accordion>{questions.map(...)}</Accordion>24 * </Container>25 * </section>26 *27 * | Rule | Concept | Where in this file |28 * | ---- | -------------------------------- | ----------------------------------------------------------- |29 * | R4 | Extends native el | `React.ComponentProps<'section'>` + FAQ props |30 * | R6 | data-slot on root | `data-slot="faq"` |31 * | R10 | Composition seam (questions) | Array<{question, answer}> |32 * | R14 | Declares min viewport | `data-min-viewport={String(MIN_VIEWPORT)}` + exported const |33 * | R18 | Tailwind only | Zero inline `style` |34 * | R19 | Tokens only | Container + Accordion own all tokens |35 * | R25 | Client component | Accordion is client-tier |36 * | R26 | A11y from Accordion | Accordion owns disclosure ARIA |37 */3839import { cn } from '@/lib/utils';40import {41 Accordion,42 AccordionItem,43 AccordionTrigger,44 AccordionContent,45} from '@/components/ui/accordion';46import { Container } from '@/components/ui/container';47import { Skeleton } from '@/components/ui/skeleton';48import { Stack } from '@/components/ui/stack';49import { Typography } from '@/components/ui/typography';5051export const MIN_VIEWPORT = 320 as const;5253interface FAQItem {54 question: React.ReactNode;55 answer: React.ReactNode;56}5758interface FAQProps extends Omit<React.ComponentProps<'section'>, 'title'> {59// … truncated
More from interlace-ui
All 140 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| A11y Startera11y-starter | interlace-ui | Components | Free | no deps | |
| Accordionaccordion | interlace-ui | Components | Free | no deps | |
| Alertalert | interlace-ui | Components | Free | no deps | |
| Alert Dialogalert-dialog | interlace-ui | Components | Free | no deps | |
| Animated Gradient Textanimated-gradient-text | interlace-ui | Components | Free | no deps | |
| Animated Grid Patternanimated-grid-pattern | interlace-ui | Components | Free | no deps | |
| Animated Listanimated-list | interlace-ui | Components | Free | no deps | |
| Article Cardarticle-card | interlace-ui | Components | Free | no deps |
