Skip to content

Collapsible for Angular

AngularLayout

Single disclosure: a native button (aria-expanded, aria-controls), optionally inside a heading, that shows and hides one content region, such as ‘Show more details’ or an advanced-settings section.

  • One disclosureA native button that shows and hides a single region of content.
  • Optional headingWrap the trigger in a heading to keep the page outline intact.
  • Plain or borderedA light inline look or a bordered panel.
  • Change eventReports when the user opens or closes it; programmatic changes stay quiet.

Behavior, design tokens, and limitations are described on the Collapsible page; this page covers the Angular API.

import { Component } from '@angular/core';
import type { CollapsibleChangeDetail } from '@absoluteui/components/collapsible';
import { AuiCollapsible } from '@absoluteui/angular/collapsible';
@Component({
selector: 'app-delivery-help',
imports: [AuiCollapsible],
template: `<aui-collapsible label="How is the delivery date calculated?" [content]="help" [open]="open" (changed)="onToggle($event)"></aui-collapsible>`,
})
export class DeliveryHelpComponent {
open = false;
readonly help = 'Orders placed before 14:00 on a business day ship the same day.';
onToggle(detail: CollapsibleChangeDetail): void {
this.open = detail.open;
}
}
Terminal window
npm install @absoluteui/angular @absoluteui/components @absoluteui/core @absoluteui/theme

Setup with provideAbsoluteUI() is covered in Getting started. Styles are included with the component.

import { AuiCollapsible } from '@absoluteui/angular/collapsible';

Defaults for every instance: provideAbsoluteUIConfig({ components: { collapsible: { ... } } }) (see Configuration).

Class AuiCollapsible; template reference #ref="auiCollapsible".

Server rendering: Renders on the server; the browser re-creates it after hydration.

Input Type Default Description
label string Required. Trigger text.
content string | Node Required. Region content; strings are rendered as text.
open boolean false Initial state; with update(), sets the state.
disabled boolean false Blocks toggling (aria-disabled; the trigger stays focusable).
headingLevel CollapsibleHeadingLevel | null Wrap the trigger in a heading of this level.
variant CollapsibleVariant 'plain' plain: text trigger; bordered: full-width trigger in a bordered surface.
icons Partial<CollapsibleIcons> Icon slot overrides.
Output Payload Description
(changed) CollapsibleChangeDetail The user toggled the content: { open }. Re-emits aui-change.

Call them through a viewChild query or a template reference.

Method Description
show(): void Show the content (no event).
hide(): void Hide the content (no event).
toggle(): void Toggle the content (no event).

Pattern: WAI-ARIA APG Disclosure: a button with aria-expanded and aria-controls shows and hides one content region.

The Angular component renders the framework-neutral component, so its keyboard support, roles, WCAG 2.2 criteria, budgets, and import cost apply unchanged: see Collapsible: Accessibility and performance.