Talisman LogoTalisman Logo Design System
Browse documentation
Components

Accordion

Stacked sections where each header shows or hides its content, with one or several items open at a time.

Stableimport { Accordion } from "@repo/ui/accordion";Source

Petição inicial, procuração e comprovante de residência do cliente.

Marina Costa revisa; Paulo Nunes aprova o protocolo.

Prazo para contestação até 12/12/2026.

type
<Accordion collapsible type="single" />

When to use

  • To organize a long page into short sections people open when they need them, such as documents, reviewers and deadlines.
  • To keep the page scannable. Each header shows what is inside, which follows Structure you can scan in the manifesto.
  • When items have the same shape and the user reads them one after the other, such as the results of several checks.

When not to use

  • Content people need every time. Show it. An accordion hides it behind a click.
  • One block that hides and shows. Use Collapsible.
  • Switching between views of the same data. Use Tabs.
  • Steps of a task. Use a stepper, so people see progress.
  • Two short items. Show both. The click costs more than the space.

Anatomy

Part Role
Accordion The root. Sets type, and spaces the items by 32px.
AccordionItem One section. It needs a unique value.
AccordionTrigger The header button, with an optional icon, tag and actions, and a chevron.
AccordionContent The panel. It animates its height and has 16px of padding above and below.
AccordionRichSection An optional block inside the panel: a small label above its text.

Sizes

Conteúdo da seção.

Conteúdo da seção.

Conteúdo da seção.

Size Style Use for
small 16px, medium weight. Default. Items in a list or a side panel.
medium 14px, uppercase, wide tracking. Groups in dense panels.
large 24px, tight tracking. The main sections of a page.

Examples

One or several open

type="single" keeps one item open, and collapsible lets people close it. type="multiple" lets people open several.

Petição inicial, procuração e comprovante de residência do cliente.

Marina Costa revisa; Paulo Nunes aprova o protocolo.

Prazo para contestação até 12/12/2026.

Icon, tag and actions

Use icon to name the kind of content, tag to show a state or a count, and actions for a control that belongs to the section. Actions are rendered next to the trigger, never inside it, so the controls are not nested.

Petição inicial, procuração e comprovante.

Marina Costa aguarda a contestação.

Rich content

Tese principal

Ausência de relação jurídica entre as partes.

Pedido

Improcedência total dos pedidos da petição inicial.

Content

  • The header names the section in a few words: “Documentos do processo”, not “Seção 1”.
  • Use tag for a fact people need before they open it: “3 anexos”, “Pendente”.
  • Open by default the section most people need first (defaultValue).
  • Keep the panel short. Put long content in its own page.

Do and don’t

Petição inicial, procuração e comprovante de residência do cliente.

Marina Costa revisa; Paulo Nunes aprova o protocolo.

Prazo para contestação até 12/12/2026.

DoGroup secondary sections and open the first one people need.

O prazo para contestação vence hoje às 18h.

Don'tDon't hide what people must see, like a deadline. They may never open it.

Accessibility

  • Built on Radix Accordion. Each header is a heading (h3) that holds a button with aria-expanded and aria-controls; the panel has role="region" and is labelled by the button.
  • Keyboard: Space and Enter toggle the item. ArrowDown and ArrowUp move focus between headers, and Home and End go to the first and last.
  • The chevron, and the icon passed in icon, are aria-hidden. The label is the accessible name, so it must say what is inside.
  • The focus ring shows on focus-visible (see Known issues for its color).
  • The height animation uses Framer Motion and turns off with prefers-reduced-motion.
  • The trigger row is at least 32px high and the chevron is 32px.

Code

import {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
} from "@repo/ui/accordion";

<Accordion collapsible defaultValue="documents" type="single">
  <AccordionItem value="documents">
    <AccordionTrigger>Documentos do processo</AccordionTrigger>
    <AccordionContent>
      Petição inicial, procuração e comprovante.
    </AccordionContent>
  </AccordionItem>
  <AccordionItem value="deadlines">
    <AccordionTrigger>Prazos</AccordionTrigger>
    <AccordionContent>Contestação até 12/12/2026.</AccordionContent>
  </AccordionItem>
</Accordion>;

Props

Accordion
PropTypeDefaultDescription
collapsiblebooleanfalseWith `type="single"`, lets the user close the open item. Not available with `multiple`
defaultValuestring | string[]—Initially open item value (a string for `single`, an array for `multiple`)
disabledbooleanfalseDisables every item
onValueChange(value: string | string[]) => void—Called when the open items change
type"single" | "multiple"—`single` keeps one item open at a time, `multiple` allows several
valuestring | string[]—Controlled open item value
AccordionItem
PropTypeDefaultDescription
valuestring—Unique value that identifies the item. Required.
disabledbooleanfalsePrevents the user from opening this item.
AccordionTrigger
PropTypeDefaultDescription
size"large" | "medium" | "small""small"Size of the label.
iconReactNode—Icon before the label. Decorative.
tagReactNode—A Tag or Badge between the label and the chevron.
actionsReactNode—Controls beside the trigger, outside the button, so they are not nested.
hideChevronbooleanfalseHides the expand and collapse chevron.
AccordionContent
PropTypeDefaultDescription
indentbooleanfalseAdds 28px on the left to align the content with the label when the trigger has an icon.
classNamestring—Classes for the inner wrapper that holds the padding.
containerClassNamestring—Classes for the outer animated wrapper.
AccordionRichSection
PropTypeDefaultDescription
labelReactNode—Small title above the text.
childrenReactNode—The text of the section. Required.
classNamestring—Extra classes for the section.

Known issues

Issue Effect
The trigger focus ring uses ring-ring, and the preset has no ring color (only old-ring). The ring falls back to Tailwind’s default translucent blue instead of the focus token.
The chevron hover and open background is --ghost-hover-bg, 5% opacity. A translucent fill, against the repository rule of solid backgrounds. It is barely visible on the gray background.
AccordionRichSection renders a raw p, and the trigger sizes are hand-written classes. The text does not follow the Typography scale, so a change to the type tokens does not reach it.
Accordion has gap-8 and no border or divider between items. Items are far apart and there is no line to show where one ends, so the grouping depends on spacing alone.
AccordionContent keeps its own isOpen state, which starts as false and is synced from data-state in an effect. An item open by default is rendered collapsed (height 0) first and expands after the page loads, so the content appears late.
Edit this page on GitHub