Skip to content

pantoken / 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">Toggle panel</button>
<instui-drawer-layout id="drawer" open placement="start">
  <nav slot="tray">…</nav>
  <article>Main content</article>
</instui-drawer-layout>