Skip to content

Components

Accordion and Collapsible

A section that opens and closes, with the ARIA, the arrow keys and the roving focus handled once. The panel does not pop — it settles, using the same layer rise as the Popover and the Card stack.

Examples

import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Collapsible, CollapsibleContent, CollapsibleTriggerRow, } from "@luc/ui";

One section at a time

Single mode is the settings pattern: opening one section closes the last, and collapsible lets the reader close everything.

Every provider wrote inside its window. 1,284 bars landed for BTCUSDT 1h and the 1d rollup matched the hourly sum to the tick.

One surface, many sections

Card gives every section its own surface; flush keeps one and separates rows with a hairline, which is what long-form documentation and an FAQ want.

A disclosure without an item

Collapsible is the same behaviour for one region — no item wrapper, no roving focus, and an aside slot that can hold a control.

API

Component props
PropTypeDefaultNotes
Accordion type"single" | "multiple"—Radix's own contract: how many sections may be open.
Accordion collapsibleboolean—In single mode, allow closing the open item.
AccordionItem variant"card" | "flush""card"Own surface, or one surface with hairlines.
AccordionTrigger icon / asideReactNode—Leading and right-aligned slots before the chevron.
AccordionContent paddedbooleantrueInner padding; off for a list or a table.
CollapsibleRadix Root—One region, no item and no roving focus.

Usage

import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "@luc/ui";
<Accordion type="single" collapsible defaultValue="ingestion">
  <AccordionItem value="ingestion">
    <AccordionTrigger>Ingestion</AccordionTrigger>
    <AccordionContent>…</AccordionContent>
  </AccordionItem>
</Accordion>

Guidelines

Do

  • Use the accordion when several sections are worth reading but only one or two are usually open, and the reader needs to compare their headings.
  • Use `Collapsible` when there is one region; it has no item wrapper and no roving focus, which is the smaller instrument for one disclosure.

Don't

  • Hide content a reader always needs behind a disclosure — an accordion is a choice about attention, not a place to save space.

Accessibility

Each trigger is a real button inside a heading, with `aria-expanded` and `aria-controls` pointing at its panel. Arrow keys move between headers in the group, and collapsing unmounts the panel unless `forceMount` is set.

Luc UI v1.0Accordiondark theme