data-pin-sticky="false"pinit.jspinit.js<script type="text/javascript" async defer src="//assets.pinterest.com/js/pinit.js"></script>
<a href="https://www.pinterest.com/pin/create/button/" data-pin-do="buttonBookmark"> </a>
| Attribute | Description | Values | Default |
|---|---|---|---|
data-pin-do | Determines whether the Pinner can save any image from the page (all images will appear in
the Image Picker form) or is restricted to saving a particular image (and is taken straight
to the Pin Create form). | buttonBookmarkbuttonPinbuttonPinmediaurldescription | buttonBookmark |
data-pin-id | If you’ve already saved this image, use this attribute to treat any new Pins of this image
as repins of the original. Doing this can give you a better feel for engagement, because any
Pins you create will count towards repins of your original Pin. This attribute is applied
individually to images on your page. | The Pin URL | [not set] (new Pin) |
data-pin-nopin | The image can't be saved, and hover buttons won't appear on the image. This
attribute is applied to individual images on your page. | [any value] or [blank] If you pass in any value, nobody can Pin the image. | [not set] |
| Attribute | Description | Values | Default |
|---|---|---|---|
data-pin-hover | Shows the Save button only when a user hovers over images. This applies to all images on the
page. Add this attribute to your call to pinit.js. | [any value] or [not set] If you pass in any value, the Save button will appear on hover for
all images on the page, unless the image includes the data-pin-nopindata-pin-no-hover | No hover ([not set]) |
data-pin-sticky | Sticky buttons are on by default when data-pin-hover="true" | [false] If you pass in falsedata-pin-hover | [not set] |
data-pin-round | Changes the Save button to the round and red style. This overrides the data-pin-colordata-pin-count | true | rectangle ([not set]) |
data-pin-tall | Changes the height of the Save button. Rectangular buttons are twice as wide as they are
tall. Add this attribute to your call to pinit.js to change all buttons on your page, or add
this attribute to a single image to change the button only for that image. | Rectangular buttons: true | [Not set] |
data-pin-count | Shows the Pin count for one-image ( data-pin-do="buttonPin"pinit.js | abovebeside | [Not set] |
data-pin-custom | If you set this, we won't touch any custom HTML or CSS you add for the button. Using a
custom image will override all other button style attributes. Make sure that your custom
Save buttons follow our brand guidelines.
See custom buttons for more information about using custom Save
buttons. Add this attribute to your call to pinit.js to change all buttons on your page, or
add this attribute to a single image to change the button only for that image. | true | [not set] |
| Attribute | Description | Values | Default |
|---|---|---|---|
data-pin-description | Overrides the default image description and substitutes an image description you provide.
You can include up to 500 characters, but only 75-100 will appear in grid view. For tips on
using descriptions, see best practices. This attribute is added
individually to images on your page. | User-defined description | Page title |
data-pin-media | Overrides the image and substitutes a different image in the Pin Create form. For tips on
using media, see best practices. This attribute is added individually to
images on your page. | Image URL | Original source image |
data-pin-url | Overrides the image's page URL and substitutes the URL of your choice. This attribute
is added individually to images on your page. | URL | URL of the page where the image is |
data-pin-no-hover | Hover buttons won't appear over this image, but the image can still be saved unless the
data-pin-nopin | [any value] or [not set] If you pass in any value, hover buttons won't appear on the
image. | [not set] |
| Attribute | Description | Values | Default |
|---|---|---|---|
data-pin-error | Logs all build and interaction events to the console. Add this attribute to your call to
pinit.js. | [any value] or [not set] | [not set] |
data-pin-error | The name of the function you want us to call if one of our API endpoints replies with an
error. You have to build this yourself. It would be useful in combination with
data-pin-build | User defined | [not set] |
data-pin-tag | Creates a logging tag for analytics. Tags may include the characters a-z, A-Z, 0-9 and
underscore, and are constrained to 32 characters. | User defined | [not set] |
data-pin-do="buttonPin"data-pin-save="true"true<a data-pin-do="buttonBookmark" href="https://www.pinterest.com/pin/create/button/"> </a>
data-pin-shape="round"data-pin-do="buttonPin"data-pin-round="true"rounddata-pin-save="false"href="https://www.pinterest.com/pin/create/button/?url=URLofImageToPin&description=DescriptionOfImage"<img src="//assets.pinterest.com/images/pidgets/pinit_fg_en_round_red_16.png" /><a data-pin-do="buttonPin" href="https://www.pinterest.com/pin/create/button/?url=http://www.foodiecrush.com/2014/03/filet-mignon-with-porcini-mushroom-compound-butter/&media=https://i.pinimg.com/736x/17/34/8e/17348e163a3212c06e61c41c4b22b87a.jpg&description=So%20delicious!" data-pin-shape="round" > </a>
data-pin-tall="true"data-pin-do="buttonPin"data-pin-tall="true"data-pin-save="true"href="https://www.pinterest.com/pin/create/button/?url=URLofImageToPin&description=DescriptionOfImage"<a data-pin-do="buttonPin" data-pin-tall="true" data-pin-save="true" href="https://www.pinterest.com/pin/create/button/?url=http://www.foodiecrush.com/2014/03/filet-mignon-with-porcini-mushroom-compound-butter/&media=https://i.pinimg.com/736x/17/34/8e/17348e163a3212c06e61c41c4b22b87a.jpg&description=So%20delicious!" data-pin-height="28" > </a>
data-pin-count="above"<a data-pin-do="buttonPin" data-pin-count="above" data-pin-save="true" href="https://www.pinterest.com/pin/create/button/?url=http://www.foodiecrush.com/2014/03/filet-mignon-with-porcini-mushroom-compound-butter/&media=https://i.pinimg.com/736x/17/34/8e/17348e163a3212c06e61c41c4b22b87a.jpg&description=So%20delicious!" data-pin-config="above" > </a>
data-pin-count="beside"<a data-pin-do="buttonPin" data-pin-count="beside" data-pin-save="true" href="https://www.pinterest.com/pin/create/button/?url=http://www.foodiecrush.com/2014/03/filet-mignon-with-porcini-mushroom-compound-butter/&media=https://i.pinimg.com/736x/17/34/8e/17348e163a3212c06e61c41c4b22b87a.jpg&description=So%20delicious!" data-pin-config="beside" > </a>
data-pin-custom="true"<a data-pin-do="buttonPin" data-pin-count="beside" data-pin-custom="true" data-pin-save="false" href="https://www.pinterest.com/pin/create/button/?url=http://www.foodiecrush.com/2014/03/filet-mignon-with-porcini-mushroom-compound-butter/&media=https://i.pinimg.com/736x/17/34/8e/17348e163a3212c06e61c41c4b22b87a.jpg&description=So%20delicious!" data-pin-custom="true" > <img src="https://addons.opera.com/media/extensions/55/19155/1.1-rev1/icons/icon_64x64.png" width="25" height="25" /> </a>
<script async defer src="//assets.pinterest.com/js/pinit.js"></script>
data-pin-do="<PIN_TYPE>"data-pin-custom="true"buttonPinbuttonBookmarkdata-pin-do="buttonPin"data-pin-do="buttonBookmark"truedata-pin-customfalse<a href="https://www.pinterest.com/pin/create/button/" data-pin-do="buttonBookmark" data-pin-custom="true" > --YOUR CUSTOM HTML-- </a>
pinit.jspinit.js| Function | Description |
|---|---|
PinUtils.pinAny(); | Takes no arguments. This function opens the Image Picker form and lets the Pinner save any image from your page. |
PinUtils.pinOne(<PIN>); | This function opens the Pin Create form and restricts the user to saving an image you have chosen from your site. Three fields are available to pass in <PIN>
Example:
|
PinUtils.repin('<PIN_ID>'); | This function links to an already existing Pin rather than creating a new Pin. It requires an existing Pin id. Example: PinUtils.repin('99360735500167749'); |
PinUtils.pinOne ( { url: 'https://www.flickr.com/photos/kentbrew/6851/', media: 'https://farm8.staticflickr.com/7027/68517.jpg', description: 'Next stop: Pinterest!' } );`
data-pin-util="<YOUR_VAR_NAME>"<button class="social pinterest" data-media="http://tinyurl.com/p3rqf54" data-description="A delicious burger" ></button> <script> var pinOneButton = document.querySelector('.pinterest'); pinOneButton.addEventListener('click', function () { PinUtils.pinOne({ media: e.target.getAttribute('data-media'), description: e.target.getAttribute('data-description'), }); }); </script>
data-pin-mediadata-pin-mediadata-pin-descriptiondata-pin-urlpinit.js<script type="text/javascript" async defer src="//assets.pinterest.com/js/pinit.js"></script>
<a href="https://www.pinterest.com/<your-profile-here>/" data-pin-do="buttonFollow"> Your profile name here </a>