• This repository has been archived on 14/Feb/2018
  • Stars
    star
    151
  • Rank 246,057 (Top 5 %)
  • Language
    JavaScript
  • Created about 9 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Note: This project is no longer actively maintained by Pinterest.


react-pinterest

As ReactJS continues to increase in popularity for both startups and large-scale technology companies, we wanted to make it as easy as possible to add Pinterest content onto these sites. This helps both you and us. The more content you drive into Pinterest, the more traffic you get in return. React brings widgets to a whole new level, and we are excited to introduce a React component collection of our already popular Pinterest widgets.

Install

npm install react-pinterest --save

The full list of available widgets are:

  • Pin It Button
  • Pinterest Follow Button
  • Pinterest Pin Widget
  • Pinterest Profile Widget
  • Pinterest Board Widget
  • Pinterest Grid

Pin It Button

prop type default notes
type string 'any' enum of { 'any', 'one' }
color string 'grey' enum of { 'red', 'white', 'grey' }
large boolean false is large sized button
round boolean false is circular button

The following props are specific for type="one". Each prop refers to the Pin to be pinned on click. If pin is specified, it will be a repin, otherwise it will create a new Pin using media, url, and description.

prop type notes
pin string the id of the Pin to repin
media string the image url of the Pin to create
url string the link back of the Pin to create
description string the description of the Pin to create

Use:

import { PinItButton } from 'react-pinterest';

// To create a Pin one Pin It button
<PinItButton type="one" media="https://goo.gl/zFFBUK" url="https://goo.gl/hQmcWP" description="Example Stuff"/>

// To Create a repin Pin It button
<PinItButton type="one" pin="356417757988637350" />

// To Create a Pin any Pin It Button: opens the image picker overlay
<PinItButton type="any" />
<PinItButton type="any" color="white" />
<PinItButton type="any" color="white" large={true}/>
<PinItButton type="any" color="red" />
<PinItButton type="any" color="red" large={true} />
<PinItButton type="any" round={true} />
<PinItButton type="any" round={true} large={true} />

Pinterest Follow Button

prop type notes
board string the board slug of the board to follow (<username>/<board_name>)
user string the username of the user to follow

Choose either a board or user to follow. If both are specificed, board will be used.

Use:

import { PinterestFollowButton } from 'react-pinterest';

// To create a board follow button
<PinterestFollowButton board="pinterest/official-news">Official News</PinterestFollowButton>

// To create a profile follow button
<PinterestFollowButton user="pinterest">Pinterest</PinterestFollowButton>

Pinterest Pin Widget

prop type default notes
pin string required the id of the Pin to display
size string 'small' enum of { 'small', 'medium', 'large' }
lang string 'en' language code for Pin

Use:

import { PinterestPinWidget } from 'react-pinterest';

// Pin Widgets default to small
<PinterestPinWidget pin="530158187357124374" />
<PinterestPinWidget size="medium" pin="530158187357124374" />
<PinterestPinWidget size="large" pin="530158187357124374" />

Pinterest Board Widget

prop type default notes
board string required the board slug of the board (<username>/<board_name>)
width number required the width of the board widget
height number required the height of the board widget
columns number required the number of columns in the grid

Use:

import { PinterestBoardWidget } from 'react-pinterest';

<PinterestBoardWidget board="pinterest/official-news" width={300} height={300} columns={5} />

Pinterest Profile Widget

prop type default notes
user string required the username of the profile
width number required the width of the board widget
height number required the height of the board widget
columns number required the number of columns in the grid

Use:

import { PinterestProfileWidget } from 'react-pinterest';

<PinterestProfileWidget user="pinterest" width={300} height={300} columns={5} />

Pinterest Grid

prop type default notes
gutter number 0 the margin between grid elements
columns number ? the number of columns to use in the grid, if unspecified it will guess based on the width of the first grid element

Use:

import { PinterestGrid, PinterestPinWidget } from 'react-pinterest';

<PinterestGrid gutter={gutter}>
    <PinterestPinWidget pin="530158187357124374" />
    <PinterestPinWidget pin="356417757989339525" />
    <PinterestPinWidget pin="356417757986524080" />
    <PinterestPinWidget pin="356417757986724718" />
    <PinterestPinWidget pin="356417757988564358" />
    <PinterestPinWidget pin="356417757988206582" />
    <PinterestPinWidget pin="202802789445693269" />
    <PinterestPinWidget pin="89438742571585339" />
    <PinterestPinWidget pin="232850243203755319" />
    <PinterestPinWidget pin="137008013639035297" />
    <PinterestPinWidget pin="264797653065817757" />
    <PinterestPinWidget pin="144467100519920447" />
</PinterestGrid>

Running the example

npm install; cd examples; node server.js

Then open http://localhost:3000

Try adding a query param to change the PinterestPinWidget size ?size=medium or ?size=large

License

MIT

More Repositories

1

ktlint

An anti-bikeshedding Kotlin linter with built-in formatter
Kotlin
6,192
star
2

gestalt

A set of React UI components that supports Pinterest’s design language
TypeScript
4,240
star
3

PINRemoteImage

A thread safe, performant, feature rich image fetcher
Objective-C
4,009
star
4

PINCache

Fast, non-deadlocking parallel object cache for iOS, tvOS and OS X
Objective-C
2,660
star
5

querybook

Querybook is a Big Data Querying UI, combining collocated table metadata and a simple notebook interface.
TypeScript
1,923
star
6

secor

Secor is a service implementing Kafka log persistence
Java
1,845
star
7

teletraan

Teletraan is Pinterest's deploy system.
Java
1,807
star
8

knox

Knox is a secret management service
Go
1,229
star
9

pinball

Pinball is a scalable workflow manager
JavaScript
1,048
star
10

mysql_utils

Pinterest MySQL Management Tools
Python
883
star
11

snappass

Share passwords securely
Python
837
star
12

elixometer

A light Elixir wrapper around exometer.
Elixir
827
star
13

pymemcache

A comprehensive, fast, pure-Python memcached client.
Python
771
star
14

bonsai

Understand the tree of dependencies inside your webpack bundles, and trim away the excess.
JavaScript
738
star
15

rocksplicator

RocksDB Replication
C++
662
star
16

esprint

Fast eslint runner
JavaScript
661
star
17

bender

An easy-to-use library for creating load testing applications
Go
658
star
18

DoctorK

DoctorK is a service for Kafka cluster auto healing and workload balancing
Java
633
star
19

plank

A tool for generating immutable model objects
Swift
469
star
20

riffed

Provides idiomatic Elixir bindings for Apache Thrift
Elixir
307
star
21

thrift-tools

thrift-tools is a library and a set of tools to introspect Apache Thrift traffic.
Python
233
star
22

elixir-thrift

A Pure Elixir Thrift Implementation
Elixir
214
star
23

widgets

JavaScript widgets, including the Pin It button.
JavaScript
210
star
24

singer

A high-performance, reliable and extensible logging agent for uploading data to Kafka, Pulsar, etc.
Java
178
star
25

terrapin

Serving system for batch generated data sets
Java
176
star
26

git-stacktrace

Easily figure out which git commit caused a given stacktrace
Python
158
star
27

jbender

An easy-to-use library for creating load testing applications.
Java
156
star
28

ptracer

A library for ptrace-based tracing of Python programs
Python
155
star
29

pinlater

PinLater is a Thrift service to manage scheduling and execution of asynchronous jobs.
Java
135
star
30

memq

MemQ is an efficient, scalable cloud native PubSub system
Java
129
star
31

api-quickstart

Code that makes it easy to get started with the Pinterest API.
Python
122
star
32

it-cpe-cookbooks

A suite of Chef cookbooks that we use to manage our fleet of client devices
Ruby
118
star
33

psc

PubSubClient (PSC)
Java
117
star
34

pinterest-api-demo

JavaScript
106
star
35

PINOperation

Objective-C
104
star
36

orion

Management and automation platform for Stateful Distributed Systems
Java
101
star
37

soundwave

A searchable EC2 Inventory store
Java
96
star
38

PINFuture

An Objective-C future implementation that aims to provide maximal type safety
Objective-C
83
star
39

kingpin

KingPin is the toolset used at Pinterest for service discovery and application configuration.
Python
69
star
40

arcanist-linters

A collection of custom Arcanist linters
PHP
63
star
41

pagerduty-monit

Wrapper scripts to integrate monit and PagerDuty.
Shell
60
star
42

pinrepo

Pinrepo is a highly scalable solution for storing and serving build artifacts such as debian packages, maven jars and pypi packages.
Python
58
star
43

transformer_user_action

Transformer-based Realtime User Action Model for Recommendation at Pinterest
Python
49
star
44

quasar-thrift

A Thrift server that uses Quasar's lightweight threads to handle connections.
Java
47
star
45

pinterest-python-sdk

An SDK that makes it quick and easy to build applications with Pinterest API.
Python
47
star
46

yuvi

Yuvi is an in-memory storage engine for recent time series metrics data.
Java
45
star
47

atg-research

Python
41
star
48

slackminion

A python bot framework for slack
Python
22
star
49

api-description

OpenAPI descriptions for Pinterest's REST API
18
star
50

l10nmessages

L10nMessages is a library that makes internationalization (i18n) and localization (l10n) of Java applications easy and safe.
Java
17
star
51

thriftcheck

A linter for Thrift IDL files
Go
16
star
52

arcanist-owners

An Arcanist extension for displaying file ownership information
PHP
16
star
53

tiered-storage

Pinterest's simplified and efficient Tiered Storage implementation for Kafka
Java
13
star
54

.github

Pinterest's Open Source Project Template
12
star
55

homebrew-tap

macOS Homebrew formulas to install Pinterest open source software
Ruby
12
star
56

pinterest-python-generated-api-client

This is the auto-generated code using OpenAPI generator. Generated code comprises HTTP requests to various v5 API endpoints.
Python
12
star
57

vscode-gestalt

Visual Studio Code extension for Gestalt, Pinterest's design system
TypeScript
9
star
58

wheeljack

Work with interdependent python repositories seemlessly.
Python
8
star
59

ffffound

FFFFOUND Import tool for Pinterest
HTML
8
star
60

vscode-package-watcher

Watch package lock files and suggest to re-run npm or yarn.
TypeScript
6
star
61

graphql-lint-rules

Pinterest GraphQL Lint Rules
TypeScript
6
star
62

ss-gtm-template

This is a repository to implement the Google Tag Manager server-side tag template for Pinterest Conversions API to be deployed into Google Community Template Gallery.
Smarty
5
star
63

pinterest-magento2-extension

PHP
4
star
64

Pinterest-Salesforce-Commerce-Cartridge

JavaScript
4
star
65

figma-calculations

TypeScript
2
star
66

slate

Resource Lifecycle Management framework
Java
1
star