Collapsible

A simple expand/collapse toggle for a single content section. Lighter than an accordion.

This component requires softui.js for interactive behavior.

Default

A single collapsible section. Click the trigger to expand or collapse.

This is the collapsible content. It can contain any HTML — text, links, images, or other components. Click the trigger again to collapse.
<div class="sui-collapsible">
  <button type="button" class="sui-collapsible-trigger" aria-expanded="false">
    Toggle content
  </button>
  <div class="sui-collapsible-content">
    <div class="sui-collapsible-content-inner">
      This is the collapsible content. It can contain any HTML — text, links, images, or other components. Click the trigger again to collapse.
    </div>
  </div>
</div>

Open by Default

Add the open class and aria-expanded="true" to start expanded.

These are your project settings. You can configure build options, environment variables, and deployment targets here. Click to collapse when you're done.
<div class="sui-collapsible open">
  <button type="button" class="sui-collapsible-trigger" aria-expanded="true">
    Project settings
  </button>
  <div class="sui-collapsible-content">
    <div class="sui-collapsible-content-inner">
      These are your project settings. You can configure build options, environment variables, and deployment targets here. Click to collapse when you're done.
    </div>
  </div>
</div>

With Rich Content

The content area can hold any markup — lists, badges, nested components, etc.

project-alpha.config Config
dashboard.module.ts Active
auth.service.ts Review
<div class="sui-collapsible">
  <button type="button" class="sui-collapsible-trigger" aria-expanded="false">
    3 items tagged <span class="sui-badge sui-badge-primary" style="margin-left:8px;">3</span>
  </button>
  <div class="sui-collapsible-content">
    <div class="sui-collapsible-content-inner">
      <div style="display:flex;flex-direction:column;gap:8px;">
        <div style="display:flex;align-items:center;justify-content:space-between;gap:16px;padding:8px 12px;border-radius:var(--sui-radius-xs);box-shadow:var(--sui-shadow-inset-sm);">
          <span>project-alpha.config</span>
          <span class="sui-badge sui-badge-sm">Config</span>
        </div>
        <div style="display:flex;align-items:center;justify-content:space-between;gap:16px;padding:8px 12px;border-radius:var(--sui-radius-xs);box-shadow:var(--sui-shadow-inset-sm);">
          <span>dashboard.module.ts</span>
          <span class="sui-badge sui-badge-sm sui-badge-success">Active</span>
        </div>
        <div style="display:flex;align-items:center;justify-content:space-between;gap:16px;padding:8px 12px;border-radius:var(--sui-radius-xs);box-shadow:var(--sui-shadow-inset-sm);">
          <span>auth.service.ts</span>
          <span class="sui-badge sui-badge-sm sui-badge-warning">Review</span>
        </div>
      </div>
    </div>
  </div>
</div>

Flush

Add sui-collapsible-flush for a flat style with no card background or shadow — fits inside other containers.

Flush collapsibles have no background or shadow. They work well embedded inside cards, sidebars, or other containers where you don't want a nested card look.
<div class="sui-collapsible sui-collapsible-flush">
  <button type="button" class="sui-collapsible-trigger" aria-expanded="false">
    Advanced options
  </button>
  <div class="sui-collapsible-content">
    <div class="sui-collapsible-content-inner">
      Flush collapsibles have no background or shadow. They work well embedded inside cards, sidebars, or other containers where you don't want a nested card look.
    </div>
  </div>
</div>

Without Icon

Add sui-collapsible-plain to hide the chevron arrow.

This collapsible has no chevron icon. The entire trigger area is still clickable. Use this when you want a cleaner look or provide your own icon inside the trigger.
<div class="sui-collapsible sui-collapsible-plain">
  <button type="button" class="sui-collapsible-trigger" aria-expanded="false">
    Click to reveal details
  </button>
  <div class="sui-collapsible-content">
    <div class="sui-collapsible-content-inner">
      This collapsible has no chevron icon. The entire trigger area is still clickable. Use this when you want a cleaner look or provide your own icon inside the trigger.
    </div>
  </div>
</div>

Multiple Independent

Each collapsible operates independently — opening one doesn't close the others (unlike a single-open accordion).

Content for section A. This is independent of the other sections below.
Content for section B. Open and close this without affecting A or C.
Content for section C. All three can be open at the same time.
<div class="sui-collapsible">
  <button type="button" class="sui-collapsible-trigger" aria-expanded="false">Section A</button>
  <div class="sui-collapsible-content">
    <div class="sui-collapsible-content-inner">
      Content for section A. This is independent of the other sections below.
    </div>
  </div>
</div>

<div class="sui-collapsible">
  <button type="button" class="sui-collapsible-trigger" aria-expanded="false">Section B</button>
  <div class="sui-collapsible-content">
    <div class="sui-collapsible-content-inner">
      Content for section B. Open and close this without affecting A or C.
    </div>
  </div>
</div>

<div class="sui-collapsible">
  <button type="button" class="sui-collapsible-trigger" aria-expanded="false">Section C</button>
  <div class="sui-collapsible-content">
    <div class="sui-collapsible-content-inner">
      Content for section C. All three can be open at the same time.
    </div>
  </div>
</div>

Disabled

Add disabled to the trigger button to prevent toggling.

You shouldn't be able to see this.
<div class="sui-collapsible">
  <button type="button" class="sui-collapsible-trigger" aria-expanded="false" disabled>
    This section is locked
  </button>
  <div class="sui-collapsible-content">
    <div class="sui-collapsible-content-inner">
      You shouldn't be able to see this.
    </div>
  </div>
</div>

Delete this item?

This action cannot be undone. This will permanently delete the item and remove all associated data.