VTEX Store Components is a collection of components that can be used to create/extend others VTEX apps.
📢 Disclaimer: Don't fork this project; use, contribute, or open issue with your feature request.
Release | Status | Initial Release | Maintenance LTS Start | End-of-life | Store Compatibility |
---|---|---|---|---|---|
[3.x] | Current Release | 2018-11-29 | 2.x | ||
[2.x] | Maintenance LTS | 2018-10-02 | 2018-12-01 | March 2019 | 1.x |
See our LTS policy for more information.
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
.
"dependencies": {
"vtex.store-components": "3.x"
}
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:
"product-price": {
"props": {
"showListPrice": true,
"showLabels": false,
}
}
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.
- Add the
styles
builder to yourmanifest.json
:
"builders": {
"styles": "1.x"
}
- Create a file called
vtex.store-components.css
inside thestyles/css
folder. Add your custom styles:
.container {
margin-top: 10px;
}
Below we have a README for each component of this project that explains how to use them.
- Animation
- Availability Subscriber
- Buy Button
- Categories Highlights
- Collection Badges
- Container
- Discount Badge
- Gradient Collapse
- Greeting
- InfoCard
- Logo
- Newsletter
- Product Description
- Product Images
- Product Name
- Product Price
- Product Specifications
- SKU Selector
- Search Bar
- Share
- Shipping Simulator
- Slider
- Notification
To start your development, create a new folder on react/components. Thats 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:
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:
import ProductPrice from './components/ProductPrice/index'
export default ProductPrice
Also, all dependencies needed should be inserted inside the react/package.json.
You can check if others are passing through similar issues here. Also feel free to open issues or contribute with pull requests.
Check it out how to contribute with this project.
To execute our tests go to react/
folder and run yarn test