Skip to main content

Carousel

Ant Design

The Carousel component shows images one at a time as slides, with an optional title and caption on each, such as announcements or product photos.

Properties​

Property
Description
Expected Value
ItemsThe slides, as a list of {src, title, description}, where src is the image URL. A plain list of image URLs also works.Array
AutoplayMoves to the next slide on its own.On or off. Default: Off
Autoplay speed (ms)Time each slide stays on screen when Autoplay is on, in milliseconds. The lowest is 500.Number. Default: 3000
DotsShows dots under the slides that show the current slide and jump to another.On or off. Default: On
ArrowsShows previous and next arrows at the sides.On or off. Default: On
EffectHow slides change. scrollx slides sideways; fade fades one into the next.scrollx, fade. Default: scrollx

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
After changeTriggers when the carousel has moved to another slide.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Set visibilityShows the component when true, hides it when false.components.carousel1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.carousel1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.carousel1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
itemsThe slides, as a list of {src, title, description}, where src is the image URL. A plain list of image URLs also works.{{components.carousel1.items}}
autoplayMoves to the next slide on its own.{{components.carousel1.autoplay}}
autoplaySpeedTime each slide stays on screen when Autoplay is on, in milliseconds. The lowest is 500.{{components.carousel1.autoplaySpeed}}
dotsShows dots under the slides that show the current slide and jump to another.{{components.carousel1.dots}}
arrowsShows previous and next arrows at the sides.{{components.carousel1.arrows}}
effectHow slides change. scrollx slides sideways; fade fades one into the next.{{components.carousel1.effect}}
currentPosition of the slide shown now, starting at 0.{{components.carousel1.current}}
isVisibleWhether the component is visible.{{components.carousel1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.carousel1.isLoading}}
isDisabledWhether the component is disabled.{{components.carousel1.isDisabled}}

Styles​

Style
Default
Primary colorTheme: Brand primary
Text colorTheme: Primary text
Container backgroundTheme: Surface 1
Border colorTheme: Default border
Border radius—
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.