dixant

Accordion

Component

About

A collapsible panel group for toggling sections of content open and closed, supporting single or multiple open panels at once.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Accordion to your project and fits it to your theme.

Code

How Accordion is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import Accordion from "@/components/ui/accordion";

export default function AccordionDemo() {
  return (
    <div className="w-full max-w-md">
      <Accordion type="single" defaultValue="one">
        <Accordion.Item value="one">
          <Accordion.Trigger>Section one</Accordion.Trigger>
          <Accordion.Content>Content one.</Accordion.Content>
        </Accordion.Item>
        <Accordion.Item value="two">
          <Accordion.Trigger>Section two</Accordion.Trigger>
          <Accordion.Content>Content two.</Accordion.Content>
        </Accordion.Item>
        <Accordion.Item value="three">
          <Accordion.Trigger>Section three</Accordion.Trigger>
          <Accordion.Content>Content three.</Accordion.Content>
        </Accordion.Item>
      </Accordion>
    </div>
  );
}

More by dixant

View all
  • Tooltip

    Tooltip

    1
  • Select

    Select

  • Tatva Input

    Tatva Input

  • Typography

    Typography

  • Avatar

    Avatar

  • Divider

    Divider

  • Stack

    Stack

  • Alert

    Alert