Configuration
Setdata-view-mode="sidebar":
- A 460px panel, the full height of the window. Full width on phones.
- An expand button in the header. It moves the panel to a large centred panel, and back. The widget remembers the reader’s choice.
- A dimmed page that does not scroll while the sidebar is open. To keep the page usable, see A docked rail.
Customizing the sidebar
Width
data-modal-expanded-size instead. data-modal-size sets the width of the centred modal only; it does not change the sidebar.
A docked rail
Keep the page clickable and scrollable while the sidebar is open:Spacing from the edges
Thedata-modal-inner-* offsets pin the sidebar away from the window edges. Give it a height that fits between them, and hide the expand button, which has nowhere to go once the panel is pinned:
On the left
data-modal-inner-justify-content="flex-start" moves the panel to the left edge, and the box shadow puts the shadow on the side facing the page. The panel still slides in from the right; data-modal-transition has no effect.
FAQ
How do I make sure the widget appears above other elements? The panel is at the top of the stacking order by default (2147483647). To let something on your page sit above it, lower it:
data-modal-open-by-default="true". It takes keyboard focus from the page, so use it only on pages that exist for the assistant.
See Component styles for every property the panel accepts.