Skip to main content
Home pageComponentsAccordion

Accordion

A collapsible section built on the native <details>/<summary> elements. Content placed in the default slot is shown when open. Wrap several in lt-accordion-group to coordinate them — opening one closes the others, unless the group's multiple is set.

Playground​

HTMLReact
ShareCopy

Usage​

<lt-accordion label="What is Latty?">
Latty is a framework-agnostic design system built on design tokens and Web Components.
</lt-accordion>

<lt-accordion label="Installation" icon-start="download" open>
Install with: pnpm add @latty-ds/tokens @latty-ds/web
</lt-accordion>

<!-- Grouped: opening one closes the others sharing the group, like radio-button grouping -->

<lt-accordion-group>
<lt-accordion label="What is Latty?" open>
Latty is a framework-agnostic design system built on design tokens and Web Components.
</lt-accordion>
<lt-accordion label="How do I install it?">Install with: pnpm add @latty-ds/tokens @latty-ds/web</lt-accordion>
</lt-accordion-group>

<!-- multiple: accordions in the group open independently instead -->

<lt-accordion-group multiple>
<lt-accordion label="Section 1" open>…</lt-accordion>
<lt-accordion label="Section 2" open>…</lt-accordion>
</lt-accordion-group>
import { Accordion, AccordionGroup } from '@latty-ds/react';

<Accordion label="What is Latty?">
Latty is a framework-agnostic design system built on design tokens and Web Components.
</Accordion>

<Accordion label="Installation" iconStart="download" open>
Install with: pnpm add @latty-ds/tokens @latty-ds/web
</Accordion>

// Grouped: opening one closes the others sharing the group

<AccordionGroup>
<Accordion label="What is Latty?" open>
Latty is a framework-agnostic design system built on design tokens and Web Components.
</Accordion>
<Accordion label="How do I install it?">Install with: pnpm add @latty-ds/tokens @latty-ds/web</Accordion>
</AccordionGroup>

// multiple: accordions in the group open independently instead

<AccordionGroup multiple>
<Accordion label="Section 1" open>…</Accordion>
<Accordion label="Section 2" open>…</Accordion>
</AccordionGroup>
<template>
<lt-accordion label="What is Latty?">
Latty is a framework-agnostic design system built on design tokens and Web Components.
</lt-accordion>

<lt-accordion label="Installation" icon-start="download" open>
Install with: pnpm add @latty-ds/tokens @latty-ds/web
</lt-accordion>

<!-- Grouped: opening one closes the others sharing the group -->

<lt-accordion-group>
<lt-accordion label="What is Latty?" open>
Latty is a framework-agnostic design system built on design tokens and Web Components.
</lt-accordion>
<lt-accordion label="How do I install it?">Install with: pnpm add @latty-ds/tokens @latty-ds/web</lt-accordion>
</lt-accordion-group>

<!-- multiple: accordions in the group open independently instead -->

<lt-accordion-group multiple>
<lt-accordion label="Section 1" open>…</lt-accordion>
<lt-accordion label="Section 2" open>…</lt-accordion>
</lt-accordion-group>
</template>

API — lt-accordion​

API — lt-accordion-group​