BloksMoleculeImage Marquee

Image Marquee

Description

The Image Marquee component is a versatile and dynamic element designed to create scrolling image displays. It allows for multiple rows of images that move horizontally, with customizable speed and layout options. This component is ideal for showcasing multiple images in an engaging, space-efficient manner.

Installation

bash
sabaccui add imageMarquee

Usage

Here are examples of how to use the Image Marquee component in a Storyblok block:

1 line with 3 images and 10 seconds duration

Preview

Image 1Image 2Image 3
Image 1Image 2Image 3
Image 1Image 2Image 3
Image 1Image 2Image 3
Image 1Image 2Image 3
Image 1Image 2Image 3

3 lines with 100px height and 20 seconds duration

Preview

Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6
Image 1Image 2Image 3Image 4Image 5Image 6

Schema

FieldTypeDescriptionDefault
imagesmultiassetAn array of image assets to be displayed in the marquee. Only image files are allowed.-
linesnumberThe number of horizontal lines in the marquee.1
lineHeightnumberThe height of each line in pixels.64
durationnumberThe time in seconds for one complete cycle of the marquee.-
overlaybooleanEnables a gradient overlay effect on the marquee.false

Notes

  1. The component uses a computed property imageRows to distribute images across the specified number of lines.
  2. Images are resized to match the specified lineHeight using Storyblok's image transformation feature.
  3. Alternate rows move in opposite directions for visual interest.
  4. The component is editable within the Storyblok editor.

Best Practices:

  • Choose images with similar aspect ratios for a consistent look.
  • Adjust the duration based on the number of images and desired speed of scrolling.
  • Use an odd number of lines for a more dynamic appearance, as it ensures the bottom row moves in the opposite direction of the top row.
  • Consider the lineHeight in relation to your overall design to ensure the marquee fits well within your layout.