Slider

Description

The Slider component is a versatile and interactive element designed to showcase multiple content items in a horizontally scrollable format. It provides a smooth, touch-friendly interface for users to navigate through a series of slides, making it ideal for image galleries, product showcases, or any content that benefits from a carousel-like presentation.

Installation

bash
sabaccui add slider

Usage

Here's an example of how to use the Slider component in a Storyblok block:

Preview

Lorem Ipsum 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Lorem Ipsum 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Lorem Ipsum 3

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Lorem Ipsum 4

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Lorem Ipsum 5

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Schema

Field NameTypeDescriptionDefault Value
itemsbloksAn array of content blocks to be displayed as slides. Only components with the tag molecule are allowed.[]

No related components specified in the provided information

Notes

  1. The component uses a horizontal scroll mechanism with snap points for smooth sliding behavior.
  2. Navigation is implemented with dots for each slide and next/previous buttons.
  3. The slider is responsive and adjusts to the container width.
  4. Accessibility features are included, such as aria labels for navigation buttons.

Best Practices:

  • Ensure all slides have a consistent aspect ratio for the best visual appearance.
  • Use high-quality images that are optimized for web performance.
  • Consider limiting the number of slides to maintain quick loading times and user engagement.
  • Provide alternative navigation methods for users who may have difficulty with touch or mouse interactions.