Product Summary Buy Button


ProductSummaryBuyButton is a VTEX Component that renders the buy button. This Component can be imported and used by any VTEX App.

📢 Disclaimer: Don't fork this project; use, contribute, or open issue with your feature request.

Table of Contents


You should follow the usage instruction in the main README.

Then, add product-summary-buy-button block into your app theme, as we do in our Product Summary app.

Blocks API

This component has an interface that describes which rules must be implemented by a block when you want to use the ProductSummaryBuyButton.

  "product-summary-buy-button": {
    "component": "ProductSummaryBuyButton"


Through the Storefront, you can change the ProductSummaryBuyButton's behavior and interface. However, you also can make in your theme app.

Prop nameTypeDescriptionDefault value
isOneClickBuyBooleanShould redirect to checkout after clicking on buyfalse
buyButtonTextStringCustom buy button text
displayBuyButtonEnumSet display mode of buy button (displayButtonAlways, displayButtonHover, displayButtonNone)displayButtonAlways
customToastURLStringSet the link associated with the Toast created when adding an item to your cart./checkout/#/cart
buyButtonBehaviorEnumWhat the buy button should do when you click it, if you pass default it will add to cart only if there is only one SKU of that product (default, alwaysGoToProduct)default

Styles API

This app provides some CSS classes as an API for style customization.

To use this CSS API, you must add the styles builder and create an app styling CSS file.

  1. Add the styles builder to your manifest.json:
  "builders": {
    "styles": "1.x"
  1. Create a file called vtex.product-summary.css inside the styles/css folder. Add your custom styles:
.buyButtonContainer {
  margin-top: 10px;

CSS Handles

CSS HandlesDescriptionComponent Source
buyButtonContainerThe main container of buy buttonindex
buyButtonClass right before buy buttonindex
isHiddenClass when button is hiddenindex