Accordion

A clean, minimal, and modern accordion component featuring smooth Framer Motion animations. Designed for clarity and ease of use, it supports both single and multiple open items and fits perfectly into documentation, FAQs, or content-heavy layouts.

uiclass-variance-authorityframer-motionfutureuikitlucide-react

Installation

$npx futureuikit add accordion

Import

import { AccordionItem } from "@/components/ui/accordion"
Layout Variant
Color Theme
Theme
Shape
Spacing

Named Keys & Props

Pass these exact named keys as props on <AccordionItem />. Click any color pill to copy the prop.

colorDefault is "default"(Black & White)
variantVisual style
"solid""outline""ghost""link"
themeSurface theme
"default""modern""clean""futuristic""brutal""halftone"
shapeCorner shape
"default""square""rounded""sharp"
spacingInner spacing
"default""2x""4x""6x""8x"

Usage Example

A basic implementation example to get you started.

Example Implementation
import { Accordion } from"@/components/ui/accordion";

const items = [
 { title:"What is Future UI?", content:"Future UI is a modern component library built with Next.js and Tailwind CSS."},
 { title:"How do I install it?", content:"You can use our custom CLI to add components to your project."},
];

export default function Example() {
 return <Accordion items={items} />;
}

Features

Key capabilities and highlights.

Key Capabilities
  • ◆Built with Framer Motion for smooth, physics-based height transitions.
  • ◆Supports single or multiple item expansion via the'allowMultiple'prop.
  • ◆Modern, minimalist design with subtle border treatments and clean typography.
  • ◆Integrated with Lucide React for intuitive directional iconography.
  • ◆Fully responsive and keyboard accessible.
  • ◆Easily customizable via Tailwind CSS classes.

Notes

Important implementation details to consider.

Implementation Details
  • ◆Install: Run'npx futureuikit add accordion'.
  • ◆Import:'import { Accordion } from "@/components/ui/accordion";'
  • ◆Data: Pass an array of'items', each with a'title'(heading) and'content'(can be text or React components).
  • ◆Behavior: Use the'allowMultiple'boolean prop to allow opening more than one section at once.
  • ◆Customization: Standard Tailwind classes can be passed through to the sub-elements for bespoke styling.