faq-accordion
vengenceui/faq-accordionFreeComponent
vengenceui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by vengenceui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.vengenceui.com/r/faq-accordion.jsonSource
1"use client";23import React, { useState } from "react";4import { cn } from "@/lib/utils";56export interface FaqItem {7 question: string;8 answer: React.ReactNode;9}1011export interface FaqAccordionProps extends React.HTMLAttributes<HTMLDivElement> {12 items?: FaqItem[];13 title?: string;14}1516const DEFAULT_ITEMS: FaqItem[] = [17 { question: "What is Vengeance UI?", answer: "Vengeance UI is a high-performance, dark-mode first component library designed for the next generation of web applications." },18 { question: "Can I use it with Tailwind CSS?", answer: "Yes! All components are built on top of Tailwind CSS and highly customizable using utility classes." },19 { question: "Are the components accessible?", answer: "Accessibility is a core focus. We ensure proper ARIA attributes, keyboard navigation, and semantic HTML structure." },20 { question: "Do I need to install a heavy npm package?", answer: "No. Vengeance UI provides a CLI that lets you copy and paste only the components you need directly into your project." },21 { question: "Is it compatible with React and Next.js?", answer: "Absolutely. The library is built with React in mind and perfectly supports Next.js Server Components and client-side rendering." },22];2324export function FaqAccordion({25 items = DEFAULT_ITEMS,26 title = "Vengeance UI FAQs",27 className,28 ...props29}: FaqAccordionProps) {30 const [activeIndex, setActiveIndex] = useState<number | null>(null);3132 const toggleItem = (index: number) => {33 setActiveIndex(activeIndex === index ? null : index);34 };3536 return (37 <div className={cn("w-full max-w-3xl mx-auto py-8 relative font-sans", className)} {...props}>38 {title && (39 <h2 className="text-center font-bold text-2xl md:text-3xl mb-10 text-neutral-500 dark:text-neutral-400">40 {title}41 </h2>42 )}4344 <ul className="w-full mx-auto list-none p-0 flex flex-col">45 {items.map((item, index) => {46 const isActive = activeIndex === index;47 return (48 <li49 key={index}50 className={cn(51 "w-full relative transition-all duration-300 ease-in",52 "border-b-2 border-neutral-100 dark:border-neutral-800",53 "last:border-b-0",54 isActive ? "border-b border-neutral-200 dark:border-neutral-700" : ""55 )}56 >57 <button58 className={cn(59// … truncated
Files it writes
More from vengenceui
All 131 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | vengenceui | Components | Free | 2 deps | |
| agent-bento-gridagent-bento-grid | vengenceui | Components | Free | 1 dep | |
| alertalert | vengenceui | Components | Free | no deps | |
| animated-buttonanimated-button | vengenceui | Components | Free | 1 dep | |
| animated-footeranimated-footer | vengenceui | Components | Free | 2 deps | |
| animated-numberanimated-number | vengenceui | Components | Free | 1 dep | |
| animated-raysanimated-rays | vengenceui | Components | Free | no deps | |
| animated-tooltipanimated-tooltip | vengenceui | Components | Free | 1 dep |
