Implement Amp Slide-out side panel #2302
Labels
INTENT TO IMPLEMENT
Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code
Type: Feature Request
Milestone
Overview
In order to maximize use of screen real-estate for page content, many mobile-optimized pages hide their main navigation in a slide-out panel, often invoked via a "hamburger" icon. This panel generally contains the global site navigation, site settings, and sometimes miscellaneous information that would normally go in a footer.
Many publications looking to port their existing mobile-optimized web pages to AMP are already using some variation of the slide-out panel, so providing AMP-native support for one should help lower the barrier to adoption.
Usage
Behavior
The
<amp-panel-button>
element becomes a<button>
tag, while the element becomes a<div>
tag which loads offscreen via transform: translateX() styles, or the browser-appropriate equivalent.Tapping/clicking on the panel button reveals the panel via animation.
The panel does not obscure the content area completely. It leaves a portion of the content area visible but inert, i.e. links and widgets do not respond to interaction, and the content area should not scroll while the panel is open. (The disabling effect is usually achieved using an invisible or translucent "scrim" element that overlays the content, but could also be handled via JavaScript event interception.) Clicking or tapping in the visible portion of the content retracts the panel and restores the content area to its interactive state.
The panel contents scroll independently of the main content area.
Constraints
To enforce appropriate usage of the panel, the following constraints apply:
<amp-img>
and<amp-iframe>
tags are disallowed within<amp-panel>
<amp-panel>
is allowed per page.<amp-panel-button>
and<amp-panel>
tags can only be placed inside the<header>
tag.<amp-panel>
will expand to the width of the elements it contains, to a maximum of 85% of the width of the page.The text was updated successfully, but these errors were encountered: