Accordion
A list of collapsible sections in a bordered box — FAQ blocks, grouped details, long settings. Build it from panels, or pass an array of items with header and content templates.
Basic
Each tx-accordion-panel has a value, a tx-accordion-header and a tx-accordion-content. [(value)] holds the open panels; several can be open at once.
Open: dns
Items
items renders a panel per item: header, content, tone, disabled and any fields of your own. The value of an item is its value or its index. opened / closed report the panel the user toggled.
Open a section
Templates
ng-template txAccordionHeader and ng-template txAccordionContent draw each item; they get the item, its index and whether it is open. The content template is created on the first open.
- Region
- Frankfurt
- CPU
- 2 vCPU
Single
[multiple]="false" keeps one panel open: opening another closes the first. The value is then a single value or null.
Open: account
Tones
tone (info, success, warn, danger) draws a coloured bar on the left of the header.
Disabled
A disabled panel cannot be opened and the arrow keys skip it.
Icons
expandIcon / collapseIcon replace the chevron (one of them is used for both states when only one is set); ng-template txAccordionToggleIcon draws your own icon from the open state.
Lazy
Content in an ng-template txAccordionContent inside tx-accordion-content is created on the first open and kept afterwards — load heavy sections only when someone opens them.
Keyboard
Up and Down move between headers, Home / End jump to the first / last, Enter or Space toggles. With selectOnFocus the arrow keys open the header they land on.
Design tokens
dt changes one accordion — here roomier headers and a tinted content area.