• websites



The amp-pinterest component allows embedding a save button or pin widget.


Import the amp-pinterest component in the header.

<script async custom-element="amp-pinterest" src=""></script>

Save button

Set data-do to buttonPin to enable pinning content on your site. These attributes are required:

  • data-url: the URL to be shared.
  • data-media the absolute image URL to be pinned.
  • data-description: the default description that appears in the pin create form.
<amp-img src="/static/samples/img/amp.jpg" width="300" height="169" alt="an image"></amp-img>
<amp-pinterest height="18" width="56" data-do="buttonPin" data-url="" data-media="" data-description="amp-pinterest in action">

Embed pin widget

To embed the pin widget, set data-do to embedPin. The data-url attribute must contain the fully-qualified URL of the Pinterest resource.

<amp-pinterest width="236" height="326" data-do="embedPin" data-url="">

如果此页面上的说明未能涵盖您的所有问题,欢迎与其他 AMP 用户取得联系,讨论您的具体用例。

前往 Stack Overflow

AMP 项目强烈鼓励您参与并做出贡献!我们希望您能成为我们开放源代码社区的持续参与者,但我们也欢迎您对所热衷问题做出一次性贡献。

编辑 GitHub 上的示例