Layout

Accordion

@xui/accordion

A vertical stack of expandable sections. One panel opens at a time by default; multiple lets several stay open. value is the two-way list of open items.

Install

pnpm add @xui/accordion

Add the barrel to a standalone component's imports:

import { XuiAccordionImports } from '@xui/accordion';

@Component({
  imports: [XuiAccordionImports],
  // …
})

Examples

Basic

Loading preview…

Multiple

Loading preview…

With disabled

Loading preview…

API

XuiAccordionItem

componentxui-accordion-item

One section of an {@link XuiAccordion}. value identifies it within the group; title is the header label (or project [xuiAccordionTitle] for rich content). The body is the default projected content.

Inputs

NameTypeDefaultvaluerequiredstringThe item's key, used by the accordion to track which items are expanded. Must be unique within the accordion.titlestringThe header text. Project [xuiAccordionTitle] content instead when the header needs markup.''disabledbooleanMake the item unopenable. The header stays visible but no longer toggles.false

XuiAccordion

componentxui-accordion

A vertical stack of expandable sections. By default one panel is open at a time; set multiple to let several stay open. value is the two-way bindable list of open item values.

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the component's own rather than replacing them.''multiplebooleanLet several items be open at once. By default opening one closes the rest.falsevaluetwo-waystring[]The values of the currently open items.[]

Methods

isExpanded(value: string): booleantoggle(value: string): void

Source

libs/ui/accordion/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.