Scroll Banner
Display a series of images with infinite scroll
Use the ScrollBanner
component to display horizontally infinitely scrolling images. They’re space efficient and can draw attention to highlight images, most notably partner or client logos, certification, or awards to build credibility and trustworthiness.
The ScrollBanner
component expects a single images
prop that describes images in the form of an array of objects. Each object can have the following properties:
src
: Sets the path to the image.alt
: Sets an alternate text for the image.width
andheight
: Sets the width and height of the image.lazy
: Optionally, you can set thelazy
property totrue
to lazy-load the image.
Image Size
You can customize the size of the banner by setting the imageSize
prop on the component. By default, the height of the images are set to 40px
:
Animation
The animation of the ScrollBanner
component can be configured in many different ways. Use the following props to disable or customize the way your animation works:
animate
: Set tofalse
to disable animation. Enabled by default.animationSpeed
: Sets the animation speed. One revolution takes 30 seconds by default.reverse
: Reverses the direction of the scroll.stopOnHover
: Sets whether the animation should be stopped on hover. Enabled by default.
Shadows
The component uses a fade-in, fade-out effect using shadows on each side. The size of the shadows can be customized or even turned off using the shadows
and shadowWidth
props:
Desaturated
The component can also be create with a desaturated effect using the desaturated
prop:
Configure With CSS
Some of the above configurations can also be configured using CSS variables, such as the image size, animation speed, and shadow width. If you need consistent styles across all of your ScrollBanner
components, prefer overriding the following CSS variables once:
API
Prop | Default | Purpose |
---|---|---|
images | - | Sets the images. |
images.src | - | Sets the path for the image. |
images.alt | - | Sets an alternate text for the image. |
images.width | - | Sets the width of the image. |
images.height | - | Sets the height of the image. |
images.lazy | - | Set to true to enable lazy loading for the image. |
imageSize | 40px | Sets the height of the images. |
animate | true | Enables infinite scroll. |
animationSpeed | 30s | Sets the animation speed. |
reverse | false | Reverses the direction of the scroll. |
shadows | true | Adds shadows to the side of the scroll banner. |
shadowWidth | 50px | Sets the width of the shadows. |
stopOnHover | true | Stops the scroll animation on hover. |
desaturated | false | Desaturates images. |
className | - | Pass additional CSS classes for the ScrollBanner component. |
Request improvement for this page