Documentation
Feedback
Guides
VTEX IO Apps

VTEX IO Apps
Share
vtex.store-components
Version: 3.173.0
Latest version: 3.173.0

The Share component allows shoppers to share a product URL via social media. This component can be imported and used by any VTEX app.

{"base64":"  ","img":{"width":1838,"height":844,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":248489,"url":"https://user-images.githubusercontent.com/67270558/134995068-62543fb4-f2fe-4f06-b220-658f4b4c7eb1.png"}}

Configuration

  1. Import the vtex.store-components app to your theme's dependencies in the manifest.json file as in the following example:

_10
"dependencies": {
_10
"vtex.store-components": "3.x"
_10
}

  1. Add the share block as a child of the store.product template (Product Details Page template). For example:

_10
"store.product": {
_10
"children": [
_10
"share"
_10
]
_10
}

  1. Then, declare the share block using the props stated in the Props table. For example:

_10
"share": {
_10
"component": "Share"
_10
}

Props

Prop nameTypeDescriptionDefault value
buttonsContainerClassStringButton container classes.true
classNameStringMain container classes.null
imageUrlStringImage url to share in social medias.
optionsOptionsShare button options, such as size.{}
shareLabelClassStringShare label classes.true
socialSocialPossible social media icons to be displayed.{Facebook: true, Twitter: true, WhatsApp: true, Pinterest: true}

options props:

Prop nameTypeDescription
sizeNumberThe size of the share button in pixels.

social props:

Prop nameTypeDescription
FacebookBooleanIf Facebook social media will be shown.
TwitterBooleanIf Twitter social media will be shown.
WhatsAppBooleanIf WhatsApp social media will be shown.

Customization

To apply CSS customizations in this and other blocks, follow the Using CSS handles for store customization guide.

CSS Handles
shareButtons
shareContainer
shareLabel
shareLoader
shareSocialButton
shareSocialIcon
See also
Vtex.store Components
VTEX IO Apps
VTEX App Store
VTEX IO Apps