Caprice LogoCaprice UI

Accordion

A set of collapsible panels with headings.

Installation

npx caprice-ui add accordion
npx shadcn add https://caprice-ui.com/r/accordion.json
npm install @caprice-ui/react

Install the following dependencies:

npm install @base-ui-components/react

Copy and paste the following code into your project.

Update the import paths to match your project setup.

Usage

import * as Accordion from "@/components/ui/accordion"
import * as Accordion from "@caprice-ui/react/accordion"
<Accordion.Root>
  <Accordion.Item value="item-1">
    <Accordion.Trigger>What is Base UI?</Accordion.Trigger>
    <Accordion.Panel>
      Base UI is a library of high-quality unstyled React components for design systems
      and web apps.
    </Accordion.Panel>
  </Accordion.Item>
</Accordion.Root>

Examples

API Reference

Root

Prop

Type

Item

Prop

Type

Trigger

Prop

Type

Panel

Prop

Type

Last updated on