Skip to content

Components

Accordion

Stacked headings that each show or hide a section of content.

Customize
Ombelle · light

Installation

Run in a project initialized with an Ombelle preset (see Get started). The component uses the saved project preset. Run the command from your app folder; it shows the changes and asks before writing.

pnpm dlx @ombelle-ui/cli@1.1.2 add accordion

Adds components/ui/accordion.tsx and installs react, @radix-ui/react-accordion, clsx, tailwind-merge, lucide-react with lifecycle scripts disabled. This is a client component.

In a liquid glass project the plan adds a notice that accessibility is not guaranteed, because text contrast depends on the background behind the glass.

Usage

example.tsx
import {
  Accordion, AccordionItem, AccordionTrigger, AccordionContent,
} from '@/components/ui/accordion'

export function Faq() {
  return (
    <Accordion type="single" collapsible>
      <AccordionItem value="preset">
        <AccordionTrigger>What does a preset change?</AccordionTrigger>
        <AccordionContent>Colors, radius, borders, shadows and type.</AccordionContent>
      </AccordionItem>
    </Accordion>
  )
}

API and states

API
Accordion (type, collapsible, value, appearance: bordered, flush; icon: chevron, plus), AccordionItem, AccordionTrigger (level), AccordionContent
Minimum states
Open, closed, disabled, focus; bordered or flush; one chevron or plus icon
Native basis
Reviewed Radix accordion primitive
Styles
Stable in Ombelle, Papier, Organic, Retro futurism, minimalist, neo-brutalism and flat, light and dark. Liquid glass: stable, accessibility not guaranteed.