Hero banner carousel with custom controls using accessible-slick
Who doesn't love hero banner carousels? Ok, lots of people. But still, if you have to build one, here's an example of how you can do it in an accessible way using accessible-slick!
This demo shows a few of the accessibility features of accessible-slick, along with some relevant tips that you can use for any carousel. In particular:
- Autoplay is enabled, which now automatically comes with a customizable pause/play button to comply with WCAG 2.2.2.
- The default pause/play icons are replaced with icons from LineAwesome using the new
pauseIconandplayIconsettings to give a modern look-and-feel. - Custom previous and next buttons are also provided (using the existing
prevArrowandnextArrowsettings) to better match the modern look-and-feel of the imagery. - The previous and next buttons are placed before the slide content (but after the autoplay toggle button) using the new
arrowsPlacementsetting in order to maintain a logical tab sequence and meet WCAG 2.4.3 and 1.3.2. - Text is overlaid on each slide, but is carefully positioned to "safe" areas to ensure good color contrast. Be careful with your background images and text choices - these are common sources of WCAG 1.4.3 violations!
