Documentation
Feedback
Guides
VTEX IO Apps

VTEX IO Apps
VTEX Store Components
Official extension
Version: 3.119.6
Latest version: 3.172.2

This page is about version 3.119.6 of the app, which is not the most recent version. The latest stable version is 3.172.2.

An error occurred while trying to load the image. https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square

Description

VTEX Store Components is a collection of components that can be used to create/extend others VTEX apps.

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

Table of Contents

Usage

This app uses our store builder with the blocks architecture. To know more about Store Builder click here.

To use this app, you need to import in your dependencies on manifest.json.


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

Then, you can add a component block into your app theme as we do with product-price in our Product Details app.

For example, now you can change the behavior of product-price block that is in the product details. See an example of how to configure:


_10
"product-price": {
_10
"props": {
_10
"showListPrice": true,
_10
"showLabels": false,
_10
}
_10
}

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:

_10
"builders": {
_10
"styles": "1.x"
_10
}

  1. Create a file called vtex.store-components.css inside the styles/css folder. Add your custom styles:

_10
.container {
_10
margin-top: 10px;
_10
}

Components Specs

Below we have a README for each component of this project that explains how to use them.

Creating a new component

To start your development, create a new folder on react/components. That's where your source code will be stored. Also create a new js file on /react, this file should be used to expose your component, like:

Project structure

Inside your react/components/<component_name> you should have:

  • index.js
  • README.md
  • [Optional] components/
  • [Optional] constants/
  • [Optional] utils/
  • [Optional] queries/
  • [Optional] mutations/
  • [Optional] styles.css

Next, inside of react/ folder you need to export your component, such as:


_10
import ProductPrice from './components/ProductPrice/index'
_10
_10
export default ProductPrice

Also, all dependencies needed should be inserted inside the react/package.json.

Troubleshooting

You can check if others are passing through similar issues here. Also feel free to open issues or contribute with pull requests.

Contributing

Check it out how to contribute with this project.

Tests

To execute our tests go to react/ folder and run yarn test

Travis CI

An error occurred while trying to load the image. https://api.travis-ci.org/vtex-apps/store-components.svg?branch=master

See also
VTEX App Store
VTEX IO Apps
BackToTopButton
VTEX IO Apps
Animation
VTEX IO Apps
Image
VTEX IO Apps
DiscountBadge
VTEX IO Apps
CategoriesHighlights
VTEX IO Apps
ShippingSimulator
VTEX IO Apps
ProductDescription
VTEX IO Apps
Share
VTEX IO Apps
ProductHighlights
VTEX IO Apps
InfoCard
VTEX IO Apps
SKUSelector
VTEX IO Apps
ProductBrand
VTEX IO Apps
SearchBar
VTEX IO Apps
Logo
VTEX IO Apps
Slider
VTEX IO Apps
Container
VTEX IO Apps
ProductName
VTEX IO Apps
AutocompleteResults
VTEX IO Apps
CollectionBadges
VTEX IO Apps
AvailabilitySubscriber
VTEX IO Apps
ProductSpecifications
VTEX IO Apps
Greeting
VTEX IO Apps
Newsletter
VTEX IO Apps
ProductImages
VTEX IO Apps
ProductPrice
VTEX IO Apps
Notification
VTEX IO Apps
GradientCollapse
VTEX IO Apps
BuyButton
VTEX IO Apps