AMP components
We've seen how AMP restricts HTML. It's not all bad though: AMP also extends HTML with replacement tags that provide similar behavior to the forbidden tags, but in a constrained and performance-optimized way. These are known as AMP components or AMP custom elements.
There are three types of AMP component:
- Built in/core components: These components are ready to use in your AMP-HTML page right away. They are distributed with the core AMP-JS library, so you don't need to explicitly include them in the head of your document. These include the most commonly used tags, such as
amp-img
,amp-video
, andamp-pixel
. - Extended components: These components extend the functionality beyond the most common core components. You need to include them explicitly before you can use them on your page. For example, to use form elements, you need to include the form extension in the head of your AMP document:
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp...