Using the carousel component

The carousel component allows you to display the carousel. The component expects image URLs for the image source (prefer the URL from the static resources or the content version object). The following is a sample code snippet for the carousel component. Notice that it has an attribute named src, which accepts the URL of the image and the attributes for the header and description.

The following code illustrates how to use a Lightning carousel component, using images stored in the Salesforce static resource:

<aura:component implements="flexipage:availableForRecordHome,flexipage:availableForAllPageTypes" access="global">
<Lightning:carousel>
<Lightning:carouselImage src = "{!$Resource.Module1}" header = "Trailhead Module 1" description = "Trailhead Module 1" alternativeText = "Trailhead Module 1">
</Lightning:carouselImage>
<Lightning:carouselImage
src = "{!$Resource.Module2}"
header = "Trailhead Module 2"
description = "Trailhead Module 1"
alternativeText = "Trailhead Module 1">
</Lightning:carouselImage>
<Lightning:carouselImage
src = "{!$Resource.Module3}"
header = "Trailhead Module 3"
description = "Trailhead Module 3"
alternativeText = "Trailhead Module 3">
</Lightning:carouselImage>
</Lightning:carousel>
</aura:component>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.165.70