Documentation
Feedback
Guides
VTEX IO Apps

VTEX IO Apps
VTEX Carousel ![https://img.shields.io/badge/-Deprecated-red](https://img.shields.io/badge/-Deprecated-red)
Official extension
Version: 2.12.2
Latest version: 2.12.2

:warning: The Carousel app has been deprecated. Although support for this block is still granted, we strongly recommend you to update your store theme's carousel using the Slider Layout in order to keep up with the component's evolution.

The VTEX Carousel app is a store component that shows a collection of banners, and this app is used by store theme.

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

Release schedule

ReleaseStatusInitial ReleaseMaintenance LTS StartEnd-of-lifeStore Compatibility
[2.x]Current Release2018-11-282.x
[1.x]Maintenance LTS2018-05-022018-11-28March 20191.x

See our LTS policy for more information.

Table of Contents

Usage

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

We add the carousel as a block in our Store.

To configure or customize this app, you need to import it in your dependencies in manifest.json.


_10
dependencies: {
_10
"vtex.carousel": "2.x"
_10
}

Then, add carousel block into your app theme as we do in our Store theme app.

Now, you can change the behavior of the carousel block that is in the store header. See an example of how to configure:


_10
"carousel#home": {
_10
"props": {
_10
"autoplay": true,
_10
"autoplaySpeed": 4,
_10
"banners": [],
_10
"height": 440,
_10
"showArrows": true,
_10
"showDots": true
_10
}
_10
}

Blocks API

When implementing this app as a block, various inner blocks may be available. The following interface lists the available blocks within carousel and describes if they are required or optional.


_10
"carousel": {
_10
"component": "Carousel"
_10
}

For now this block does not have any required or optional blocks.

Configuration

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

Prop nameTypeDescriptionDefault value
autoplayBooleanEnable automatic banner transitiontrue
autoplaySpeedNumberSet the automatic banner transition interval5
showDotsBooleanShows the carousel dotstrue
showArrowsBooleanShows the carousel arrowstrue
heightNumberSet banners height420
bannersArray(Banner)Array of banners the will be shown in the carousel[]

Banner:

Prop nameTypeDescriptionDefault value
imageStringLink for the image of the bannerN/A
mobileImageStringLink for the mobile image of the bannerN/A
tabletImageStringLink for the table image of the bannerN/A
descriptionStringThe image's descriptionN/A
urlStringThe URL where the image is pointing to, in case of external routeN/A
pageStringThe page where the image is pointing toN/A
paramsStringParameters of the URLN/A
externalRouteBooleanIndicates if the route is external or notfalse
customInternalURLStringThe relative link to where where the image is pointing to (for internal routes)N/A

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.carousel.css inside the styles/css folder. Add your custom styles:

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

CSS namespaces

Below, we describe the namespaces that are defined in the Carousel.

Class nameDescriptionComponent Source
containerThe main container of the CarouselCarousel
sliderRootThe main container of the SliderCarousel
sliderFrameThe element that contains the SlidesCarousel
slideThe container of the Banner componentCarousel
arrowThe container of the arrow svg (this namespace is applied to both arrows)Carousel
arrowLeftThe container of the left arrow svgCarousel
arrowRightThe container of the right arrow svgCarousel
arrowsContainerWrapperThe wrapper of the container of the arrowsCarousel
arrowsContainerThe container of the arrowsCarousel
containerDotsThe main container of the dotsCarousel
notActiveDotThe element of the dots that are not activesCarousel
dotThe element of the dotCarousel
activeDotThe current active dotCarousel
containerImgThe container of the imageBanner
imgRegularThe wrapper of the img element used to center the image inside the containerBanner
imgThe img elementBanner
bannerLinkThe a element that wraps the whole Banner componentBanner

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 npm test

Travis CI

{"base64":"  ","img":{"width":98,"height":20,"type":"svg","mime":"image/svg+xml","wUnits":"px","hUnits":"px","length":730,"url":"https://api.travis-ci.com/vtex-apps/carousel.svg?branch=master"}}
{"base64":"  ","img":{"width":99,"height":20,"type":"svg","mime":"image/svg+xml","wUnits":"px","hUnits":"px","length":724,"url":"https://s3.amazonaws.com/assets.coveralls.io/badges/coveralls_49.svg"}}

See also
VTEX App Store
VTEX IO Apps