This page is about version 0.11.0 of the app, which is not the most recent version. The latest stable version is 0.24.6.
Slider-Layout is a flexible solution for building sliders
of blocks
within VTEX IO Store Framework.
![{"base64":" ","img":{"width":2632,"height":1332,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":1341359,"url":"https://user-images.githubusercontent.com/27777263/70230361-e839db00-1736-11ea-9f29-7c945c10a5f7.png"}}](https://user-images.githubusercontent.com/27777263/70230361-e839db00-1736-11ea-9f29-7c945c10a5f7.png)
:warning: In order to use the slider-layout
as a substitute to the carousel
component, check this recipe out.
Configuration
- Add the slider-layout app to your theme's dependencies in the
manifest.json
, for example:
_10"dependencies": {_10 "vtex.slider-layout": "0.x"_10}
- Add the
slider-layout
to your template. For example:
_27 "slider-layout#home": {_27 "children": ["info-card#1", "info-card#2"],_27 "props": {_27 "autoplay": {_27 "timeout": 5000,_27 "stopOnHover": false_27 }_27 }_27 },_27 "info-card#1": {_27 "props": {_27 "imageUrl": "https://images.unsplash.com/photo-1524185962737-ea7c028a12cd?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80",_27 "isFullModeStyle": true,_27 "headline": "Black Friday",_27 "callToActionText": "Subscribe",_27 "textPosition": "center"_27 }_27 },_27 "info-card#2": {_27 "props": {_27 "imageUrl": "https://images.unsplash.com/photo-1524185962737-ea7c028a12cd?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80",_27 "isFullModeStyle": true,_27 "headline": "Black Friday",_27 "callToActionText": "Subscribe",_27 "textPosition": "center"_27 }_27 }
Prop name | Type | Description | Default value |
---|---|---|---|
label | String | Aria label to be used by the <Slider /> component. | 'slider' |
showNavigationArrows | mobileOnly |desktopOnly |always |never | Controls when should navigation arrows be rendered. | 'always' |
showPaginationDots | mobileOnly |desktopOnly |always |never | Controls when should pagination dots be rendered. | 'always' |
infinite | Boolean | Controls if the slider should or should not be infinite. | false |
navigationStep | Number |'page' | How many slides should be slid when the user navigates. When set to 'page' , the number of slides that will slide is equal to the number of slides in a page of the slider. | 'page' |
usePagination | Boolean | Toggles whether or not to use a fluid scroll for navigation, disabling the notion of a "page". | true |
itemsPerPage | { desktop: Number, tablet: Number, phone: Number } | Controls how many slides should be shown on each type of device. | { desktop: 5, tablet: 3, phone: 1 } |
slideTransition | { speed: Number, delay: Number, timing: String } | Controls the transition animation between slides. | { speed: 400, delay: 0, timing: '' } |
autoplay | { timeout: Number, stopOnHover: Boolean } | Controls the autoplay feature. | undefined |
fullWidth | Boolean | Controls whether or not the slides should occupy the full available width, making the arrows appear on top of them. | true |
arrowSize | Number | Controls the size (height and width) in pixels of the arrows. This is a responsive prop, which means you can pass different values for each breakpoint. | 25 |
Customization
In order to apply CSS customizations in this and other blocks, follow the instructions given in the recipe on Using CSS Handles for store customization.
CSS Handles |
---|
sliderLayoutContainer |
sliderTrackContainer |
sliderTrack |
slide |
slideChildrenContainer |
sliderLeftArrow |
sliderRightArrow |
sliderArrows |
paginationDotsContainer |
paginationDot |
paginationDot--isActive |