Stay updated about new components on Twitter

Accordion

The Accordion component lets users show and hide sections of related content on a page.

Preview

Installation

bash
npx edithspace-ui add accordion

tsx
import { Accordion, AccordionHeader, AccordionContent, AccordionProvider } from "@/components/edithspace-ui/Accordion";

Basic Usage

With Custom Icon

import { FiInfo } from "react-icons/fi";

<Accordion icon={<FiInfo />}>
  <AccordionHeader>With Custom Icon</AccordionHeader>
  <AccordionContent>
    This accordion has a custom icon in the header.
  </AccordionContent>
</Accordion>

Props Reference

Prop Name
Type
Default
Description
Prop NameTypeDefaultDescription