Sliders
If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.
To enable the slider in the block manifest, include the landing_carousel extension.
How to Configure the Slider
The minimal configuration is as follows:
'assets' => [
'ext' => ['landing_carousel'],
],
<div class="js-carousel">
<div class="js-slide">Slide 1</div>
<div class="js-slide">Slide 2</div>
</div>
What the Slider Extension Does
The landing_carousel extension initializes the slider for the js-carousel container and processes the data-* attributes that control display, navigation, and autoplay.
Markup
The markup uses two utility classes:
js-carousel— the root container of the sliderjs-slide— an individual slide
By default, the slider displays one slide, without arrows, pagination, or autoplay. The behavior can be configured through data-* attributes on the js-carousel element.
Key Attributes
data-arrows-classes— classes for both arrowsdata-arrow-left-classes— classes for the left arrowdata-arrow-right-classes— classes for the right arrowdata-pagi-classes— classes for the pagination blockdata-slides-show— number of slides to show on the screendata-slides-scroll— number of slides to scroll at one timedata-autoplay— enable/disable autoplaydata-speed— autoplay speed in millisecondsdata-pause-hover— stop autoplay on hoverdata-fade— fade effect for slide transitions, works correctly withdata-slides-show="1"data-vertical— vertical slider modedata-rows— number of rowsdata-infinite— loopingdata-responsive— responsive rules based on breakpointsdata-center-mode— center the active slidedata-center-padding— padding on the edges in center modedata-variable-width— slides with variable widthdata-initial-slide— initial slide on loaddata-rtl— right-to-left display directiondata-adaptive-height— adaptive height of the container based on the current slidedata-lazy-load— lazy loading mode for imagesdata-nav-for— link to another slider, e.g., a preview sliderdata-is-thumbs— thumbnail slider mode
For data-responsive, a valid JSON array of rules is provided. Each rule has:
breakpoint— screen width in pixelssettings— settings for that breakpoint
In settings, the parameter names from Slick are used instead of data-* attributes:
arrows— show or hide arrowsprevArrow— HTML/selector for the left arrownextArrow— HTML/selector for the right arrowdots— enable or disable paginationdotsClass— CSS class for the pagination containerslidesToShow— number of slides to show on the screenslidesToScroll— number of slides to scroll at one timeautoplay— enable or disable autoplayautoplaySpeed— autoplay interval in millisecondspauseOnHover— stop autoplay on hoverfade— fade transition modevertical— vertical slider mode
Example
<div class="js-carousel"
data-arrows-classes="u-arrow-v1 g-absolute-centered--y g-width-45 g-height-45 g-color-white g-bg-primary"
data-arrow-left-classes="fa fa-chevron-left g-left-0"
data-arrow-right-classes="fa fa-chevron-right g-right-0"
data-pagi-classes="u-carousel-indicators-v1 g-absolute-centered--x g-bottom-60 text-center"
data-slides-show="3"
data-slides-scroll="2"
data-autoplay="true"
data-speed="1000"
data-pause-hover="true"
data-center-mode="true"
data-center-padding="40px"
data-initial-slide="1"
data-adaptive-height="true"
data-lazy-load="ondemand"
data-responsive='[
{
"breakpoint": 768,
"settings": {
"slidesToShow": 2
}
},
{
"breakpoint": 576,
"settings": {
"slidesToShow": 1
}
}
]'>
<div class="js-slide g-height-50vh g-brd-gray-light-v3 g-brd-around g-bg-primary-opacity-0_1">
<div class="g-flex-centered w-100 h-100">
<h3>Slide 1</h3>
</div>
</div>
<div class="js-slide g-height-50vh g-brd-gray-light-v3 g-brd-around g-bg-primary-opacity-0_1">
<div class="g-flex-centered w-100 h-100">
<h3>Slide 2</h3>
</div>
</div>
</div>
Combining with a Gallery
If the slider is used together with a gallery, include the extensions in the following order:
landing_carousellanding_gallery_cards
'assets' => [
'ext' => ['landing_carousel', 'landing_gallery_cards'],
],
Examples of Standard Blocks
Examples of this type of block can be viewed in the repository through the methods landing.block.getmanifestfile and landing.block.getrepository.
Codes for some standard blocks:
01.big_with_text01.big_with_text_blocks28.5.team_4_cols_slider39.1.five_blocks_carousel45.2.gallery_app_with_slider— with a gallery
Important Considerations
data-fadeworks correctly withdata-slides-show="1"- In
data-rowsmode, thedata-slides-showanddata-slides-scrollparameters function as the number of columns - For vertical mode,
data-verticalusually requires separate configuration for arrows/pagination - When
data-verticalis enabled,verticalSwipingis also activated, so on mobile devices, vertical mode is typically disabled throughdata-responsive - To display pagination, in addition to the dots settings,
data-pagi-classesmust be specified data-infiniteworks in preview and publication mode; in the editor, looping is forcibly disabled- When combining with an embedded gallery, first include
landing_carousel, thenlanding_gallery_cards