Workday Canvas

Carousel

Enables users to navigate horizontally to view overflowing content placed inside of the component

Usage Guidance

Coming soon!

API Guidelines

Methods

Carousel< CarouselElements: RandomAccessCollection, Content: View >: View where CarouselElements.Element: Identifiable, CarouselElements.Element.ID: CustomStringConvertible { public init( _ carouselElements: CarouselElements, scrollingMode: CarouselScrollingMode = .freescrolling, interItemSpacing: SpaceToken? = nil, fadeWidth: SpaceToken? = nil, safeAreaWidth: SpaceToken? = nil, localizer: LocalizationAdapting, featureData: FeatureMetricsData, content: @escaping (CarouselElements.Element) -> Content ) }

Parameters

ParameterDescriptionDefault value
carouselElementsThe elements to be displayed in the carousel.N/A
scrollingModeThe scrolling mode of the carousel..freescrolling
interItemSpacingThe spacing between carousel items..x2
fadeWidthThe width of the fade effect at the edges of the carousel..x0
safeAreaWidthThe width of the safe area on the sides of the carousel..x4
localizerThe localizer to be used for the carousel.N/A
featureDataThe feature data to be used for the carousel.N/A
contentThe content to be displayed in the carousel.N/A

CarouselScrollingMode

public enum CarouselScrollingMode: Equatable, Hashable { case freescrolling case pagingNoIndication(snapAnchor: HorizontalAlignment) case pagingDots( _ indicatorLocation: DotsLocation, snapAnchor: HorizontalAlignment, appearance: DotsAppearance = .normal ) case pagingNumbers(_ indicatorLocation: NumbersLocation, snapAnchor: HorizontalAlignment) public enum DotsLocation { case inside, outside } public enum NumbersLocation { case center, top, outside } public enum DotsAppearance { case normal, inverse, inverseContrast } }

Accessibility Guidelines

Coming soon!

Can't Find What You Need?

Check out our FAQ section which may help you find the information you're looking for. For further information, contact the #ask-canvas-design or #ask-canvas-kitchannels on Slack.

On this Page: