For AI agents: the complete documentation index is available at https://a3s-lab.github.io/UI/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/UI/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/UI/components/collapsible.md.

折叠内容

使用原生 details 元素收纳次要说明,同时让标题、展开状态和无脚本降级路径保持清晰。

实时预览
为什么需要此权限
获得批准前,此文件夹保持只读。

用法

<details class="collapsible" open>
  <summary>为什么需要此权限</summary><div data-collapsible-content>获得批准前,此文件夹保持只读。</div>
</details>

契约

接口值
根选择器details.collapsible
原生根元素<details>
状态open, closed, disabled
事件toggle
方法—

产品边界

折叠内容适合补充信息,不应用来隐藏完成任务所必需的字段、错误或主要操作。多个互斥区段应使用 Accordion。

组件只发布可复用的交互边界。数据获取、持久化、权限、可信内容与业务实体继续由宿主产品拥有。

可访问性

summary 保持原生键盘行为和可见焦点。禁用状态必须同时阻止指针与键盘操作,内容顺序不随视觉折叠改变。