Skip to content

pantoken-root / renderers/web-components/src / drawerLayout

变量: drawerLayout ​

const drawerLayout: ElementDefinition

Alpha

&lt;instui-drawer-layout&gt; — a side tray plus main content area. The open attribute reveals the tray; placement (start|end) picks the side. Drivable from light DOM via Invoker Commands: <button command="--toggle|--open|--close" commandfor="drawer-id">. Content goes in the default slot; the tray in slot="tray". The interactions behavior auto-toggles overlay mode based on the --pantoken-bp-md threshold.

无障碍 ​

内容面板携带 role="region",与 InstUI 的 DrawerLayout 相匹配;当周围上下文尚未为其命名时,使用 aria-label/aria-labelledby 为其标注。

示例 ​

html
<button command="--toggle" commandfor="drawer">切换面板</button>
<instui-drawer-layout id="drawer" open placement="start">
  <nav slot="tray">…</nav>
  <article>主要内容</article>
</instui-drawer-layout>