Collapsible Section
可折叠的带标题区块:带箭头、副标题和计数的标题按钮,内容在下方。
Angular: 可用 Vue: 可用 React: 可用 React Native: 暂不可用
用法
- Ada Park: share the launch checklist
- Sam Lee: review the pricing page copy
- Kai Moreno: book the design review
Every read of a locked note, newest first.
<div class="demo-stack" style="max-width: 30rem">
<sone-collapsible-section
title="Action items"
subtitle="From the last 3 meetings"
[count]="items.length"
[(open)]="open"
>
<button soneCollapsibleSectionActions soneBtn variant="ghost" size="xs" type="button">
Copy
</button>
<ul style="margin: 0; color: var(--text-secondary)">
@for (item of items; track item) {
<li>{{ item }}</li>
}
</ul>
</sone-collapsible-section>
<sone-collapsible-section title="Audit trail" [count]="12">
<p style="margin: 0; color: var(--text-secondary)">Every read of a locked note, newest first.</p>
</sone-collapsible-section>
</div>导入
import {
SoneCollapsibleSectionActionsDirective,
SoneCollapsibleSectionComponent,
} from "@surface-one/angular/collapsible-section";API 参考
SoneCollapsibleSectionActionsDirective指令
`[soneCollapsibleSectionActions]` — controls at the end of the header, outside the toggle button.
SoneCollapsibleSectionComponent组件
`<sone-collapsible-section>` — a titled section that folds, built on the Collapsible: a full-width header button (chevron, `title`, optional `subtitle` and a secondary-badge `count`) that keeps `aria-expanded` / `aria-controls` in sync, and the projected body below it. `[(open)]` binds the state. Controls in `[soneCollapsibleSectionActions]` sit at the end of the header, outside the button.
| 名称 | 类型 | 默认值 |
|---|---|---|
title必填The section's name, shown in the header button. | string | — |
subtitleA quiet line after the title (a date range, a source). | string | null | null |
countA count in a secondary badge after the title; `null` hides it. | number | string | null | null |
open双向Whether the body is shown (`[(open)]`). | boolean | false |
disabled | boolean | false |