All components

Collapsible

Reveal optional information in place.

Examples

Reveal optional information in place

Show prerequisites

Use a supported version of your Angular or React adapter.

React code
import { Collapsible } from "@accelerate/react/components";

export function Example() {
  return (
    <>
      <Collapsible>
        <summary>Show prerequisites</summary>
        <p>Use a supported version of your Angular or React adapter.</p>
      </Collapsible>
    </>
  );
}
Angular code
import { Component } from "@angular/core";
import { AccCollapsible } from "@accelerate/angular/components";

@Component({
  selector: "app-example",
  imports: [
    AccCollapsible,
  ],
  template: `
    <details accCollapsible>
      <summary>Show prerequisites</summary>
      <p>Use a supported version of your Angular or React adapter.</p>
    </details>
  `,
})
export class Example {}

Installation

Source preview. The expanded component catalog is ahead of the public npm releases. To run these examples in your own application, use packages built from the SDK source used for the previews or a release that includes the APIs below.

React
@accelerate/ui@0.4.0 and @accelerate/react@0.4.0
Angular
@accelerate/ui@0.4.0 and @accelerate/angular@0.2.0

Load @accelerate/ui/theme.css and put acc-theme on the app or the region using Accelerator components. See the framework setup guide for the theme and adapter conventions.

Usage

Add a native summary and disclosure content.

Import the React component Collapsible from @accelerate/react/components. For Angular, add AccCollapsible to the standalone component’s imports and use <details accCollapsible>.

Examples use these React parts: Collapsible. The Angular examples show the corresponding directives and template hosts.

API reference

summary
The native, keyboard-operable disclosure control.
open
Expands the disclosure initially.