Slick Carousel

Overview

Slick Carousel (v1.8.1) is the primary slider library for the Cynosure Design System. It is initialized via the shared js/components/default-slider.js utility for standard sliders, and via dedicated files for specialized variants.

Standard sliders

The default-slider.js utility handles three common slider variants. To use one in a template, add the appropriate class to the slider container:

ClassDotsArrowsNotes
.js-default-sliderYesYes (hidden on mobile)Adaptive height below 768px and 992px
.js-default-slider-altNoNoMinimal; no controls
.js-default-slider-alt-adaptiveNoNo (hidden on mobile)Adaptive height on smaller breakpoints

Importing the utility

In your block's script.js:

JavaScript
1/** 2 * Banner Block 3 * 4 * Rotating image/text carousel for the page banner area. 5 * 6 * @shared default-slider 7 * Trigger: .js-default-slider 8 * Config: dots=true, responsive adaptive height below 992px 9 * 10 * @see /guidelines/javascript/slick 11 * @see /guidelines/javascript/shared-utilities 12 */ 13import '../../js/components/default-slider.js';

Specialized slider utilities

For sliders that need a custom configuration beyond the standard presets, dedicated utility files exist:

FileTriggerUsed by
article-card-slider.js.js-article-card-sliderposts-featured
carousel-content.js.js-carousel-contentbefore-after
cta-columns-slider.js.js-cta-columns-slidercta-columns blocks
showcase-slider.js.eb-js-showcase-sliderproduct-showcase
ticker-slider.js.js-ticker-sliderticker/marquee blocks
video-carousel.js.js-video-carouselvideo carousel blocks

RTL support

All Slick instances check $("html").attr("dir") and set rtl: true automatically when the page direction is right-to-left. This is built into all Cynosure slider utilities.

Adding a new slider

If you need a slider configuration that does not match any existing variant:

  1. Add the appropriate class to your Handlebars template:
Handlebars
1<div class="js-my-slider"> 2 {{#each properties.slides}} 3 <div class="my-slider__slide"> 4 <img src="{{this.image.url}}" alt="{{this.image.alt}}"> 5 </div> 6 {{/each}} 7</div>
  1. Write a dedicated utility or add to your block's script.js:
JavaScript
1import $ from 'jquery'; 2import 'slick-carousel'; 3 4$(function () { 5 if ($('.js-my-slider').length) { 6 $('.js-my-slider').slick({ 7 dots: true, 8 slidesToShow: 3, 9 responsive: [ 10 { 11 breakpoint: 992, 12 settings: { slidesToShow: 2 }, 13 }, 14 { 15 breakpoint: 576, 16 settings: { slidesToShow: 1, arrows: false }, 17 }, 18 ], 19 }); 20 } 21});

Accessibility notes

  • Slick generates aria-label attributes for navigation buttons but these may need custom labels in your template using the prevArrow / nextArrow config options.
  • Ensure the slider container has an appropriate aria-label or aria-roledescription if the default is not descriptive enough.
  • Add prefers-reduced-motion handling via autoplay: false by default; only enable autoplay when the content requires it.