Carousel Image

lightning:carouselImage

Specifies an image used in lightning:carousel, including description and title. This component requires API version 42.0 and later.

For Aura components only. For LWC development, use lightning-carousel-image.

For Use In

Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out (Beta), Standalone Lightning App

Use lightning:carouselImage components to specify images to display in the lightning:carousel component. You can specify up to six images. The images are displayed in the order you list them in the lightning:carousel component.

For each image, use the src attribute to specify the path to the image. Optionally use header and description attributes to provide a header and descriptive text that the carousel displays below the image. You can also hyperlink the images with the href attribute.

Use the alternativeText attribute to provide assistive text for each image.

This component implements styling from carousel in the Lightning Design System.

This example creates a basic carousel with three images.

To use images in your org, upload them as static resources in the Static Resources page in Setup. To reference a resource in lightning:carouselImage, use {!$Resource.image}" syntax in your src attribute, where image is the name you provided in the Name field on the setup page.

If the image path is invalid or the image does not load because the user is offline or another reason, the description and alternative text are shown in place of the image.

This example uses static resources uploaded as a single image, and images uploaded in a zip file.

Use the alternativeText attribute to specify assistive text for each image.