The product-brand block displays either the name or the logo of a product's brand.

product-brandproduct-brand

Before you start

Ensure that you have registered brands in your store. To do so, follow the How to register brands documentation.

Configuration

  1. Import the vtex.store-components app to your theme's dependencies in the manifest.json file as in the following example:
  "dependencies": {
    "vtex.store-components": "2.x"
  }
  1. Add the product-brand block to any child of the store.product template (Product Details Page template). For example:
  "store.product": {
    "children": [
      "flex-layout.row#product",
    ]
  },
  "flex-layout.row#product": {
    "children": [
+     "product-brand"
    ]
  },  
  1. Then, declare the product-brand block using the props stated in the Props table. For example:
"product-brand": {
    "props": {
      "displayMode": "text"
    }
  },

Configuration

Prop nameTypeDescriptionDefault value
brandIdnumberThe brand ID. If no value is declared, the product context should provide the data.undefined
brandNamestringThe brand name. If no value is declared, the product context should provide the data.undefined
classesCustomCSSClassesOverrides default CSS handles. To better understand how this prop works, check this document. Note that this is only helpful if you're using this block as a React component.undefined
displayModestringDefines if the product brand will be displayed by name or logo. Possible values are logo and text.logo
excludeBrandsarrayThe brand names or brand IDs listed in the array will never be displayed by the Brand component. It is usually useful to hide default or test brand names/logos on the store front.undefined
fallbackToTextbooleanDefines the behavior of the Product Brand block when set to display a brand logo but no image is registered in the VTEX admin's Catalog. If true, it allows the logo to be replaced with the brand name. If false, neither the brand name nor the brand logo are displayed. This prop is only available for the logo display mode.true
heightnumberThe logo height. This prop is only available for the logo display mode.100
loadingPlaceholderstringDefines if the loading placeholder should have the size of the logo or the text. Possible values are: logo and text.undefined
logoWithLinkbooleanhttps://img.shields.io/badge/-Deprecated-redhttps://img.shields.io/badge/-Deprecated-red Use withLink insteadfalse
withLinkenumDefines the scenarios in which the product brand should have a link that leads to its website. Possible values are: none (never includes the link), logo (includes the link whenever the brand logo is displayed), text (includes the link whenever the brand name is displayed), and logoAndText (includes the link whenever the brand logo or the brand name is displayed).none

Customization

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

CSS Handles
productBrandContainer
productBrandName
productBrandLogo
productBrandLogoWrapper
productBrandLogoLink
productBrandNameLink
productBrandLogoSpacer
productBrandNameSpacer

Did this page help you?