Implementing tabbed content with <amp-selector>

Another widely used and intuitive UI pattern is tabbed content. Tabs provide different views within a context. There are many use cases for tabs. In e-commerce, they can be used to provide information about different aspects of a product, such as the product overview, product specifications, and product reviews. Many popular news sites use tabs to display lists of Most read and Top stories article lists that you can switch between. Let's add this to our news article example page: we'll have Related content in one tab, and Most read in another.

While tabbed content is not supported out of the box with a dedicated component, it can be implemented in AMP with the use of the amp-selector custom ...

Get AMP: Building Accelerated Mobile Pages now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.