Carousel

A row that scrolls horizontally and snaps to its slides, with previous and next arrows. Put CarouselItem or CarouselMediaItem children in it. Bind activeIndex with { "@path": "/x" } to read or set the slide in view.

Examples

Loading examples…

Props

PropTypeDescription
align"start" | "center" | "end" | "baseline" | "stretch"
justify"start" | "center" | "end" | "spaceBetween" | "spaceAround" | "spaceEvenly" | "stretch"
wrap"nowrap" | "wrap" | "wrap-reverse"
gapnumber | string4px steps when a number
rowGapnumber | string
columnGapnumber | string
paddingnumber | string4px steps when a number
backgroundstringOne of surface|surface-secondary|surface-tertiary|surface-elevated|surface-elevated-secondary|surface-inverted|surface-soft|info|warning|caution|success|danger|discovery|info-solid|warning-solid|caution-solid|success-solid|danger-solid|discovery-solid or a CSS color. Leave it unset. Only one summary panel in a Card can use "surface-secondary"
borderboolean
borderColor"default" | "subtle" | "strong" | "info" | "warning" | "caution" | "success" | "danger" | "discovery"
radius"2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "full" | number | string | object
widthnumber | string
heightnumber | string
minWidthnumber | string
maxWidthnumber | string
minHeightnumber | string
maxHeightnumber | string
flexnumber
weightnumberflex-grow in a Row or Column
aspectRatiostring
scrollableboolean
clipboolean
shadowboolean
inlineboolean
rolestringARIA role
flushbooleanNo padding
minSizenumber | stringMinimum width and height
maxSizenumber | stringMaximum width and height
disableAutoSpacingbooleanNo default gap between children
labelstringA short name of the carousel for screen readers
visibleItemsnumber
showArrowsbooleanDefault true
activeIndexnumberThe index of the slide in view. Bind it with { "@path": "/x" } to read or set it
previousLabelstringDefault "Previous"
nextLabelstringDefault "Next"
snap"none" | "proximity" | "mandatory"
snapAlign"start" | "center" | "end"

Slots

  • children · multiple

Events

  • onVisible · Sent once, the first time the container scrolls into view. Use it to load more content lazily.

A slide of a Carousel.

Loading examples…

PropTypeDescription
align"start" | "center" | "end" | "baseline" | "stretch"
justify"start" | "center" | "end" | "spaceBetween" | "spaceAround" | "spaceEvenly" | "stretch"
wrap"nowrap" | "wrap" | "wrap-reverse"
gapnumber | string4px steps when a number
rowGapnumber | string
columnGapnumber | string
paddingnumber | string4px steps when a number
backgroundstringOne of surface|surface-secondary|surface-tertiary|surface-elevated|surface-elevated-secondary|surface-inverted|surface-soft|info|warning|caution|success|danger|discovery|info-solid|warning-solid|caution-solid|success-solid|danger-solid|discovery-solid or a CSS color. Leave it unset. Only one summary panel in a Card can use "surface-secondary"
borderboolean
borderColor"default" | "subtle" | "strong" | "info" | "warning" | "caution" | "success" | "danger" | "discovery"
radius"2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "full" | number | string | object
widthnumber | string
heightnumber | string
minWidthnumber | string
maxWidthnumber | string
minHeightnumber | string
maxHeightnumber | string
flexnumber
weightnumberflex-grow in a Row or Column
aspectRatiostring
scrollableboolean
clipboolean
shadowboolean
inlineboolean
rolestringARIA role
flushbooleanNo padding
minSizenumber | stringMinimum width and height
maxSizenumber | stringMaximum width and height
disableAutoSpacingbooleanNo default gap between children

Slots

  • children · multiple

Events

  • onVisible · Sent once, the first time the container scrolls into view. Use it to load more content lazily.

A slide of a Carousel with an image on top and its children (a Caption, a Text) under it. size "sm" is 160px, "md" 240px (default), "lg" 320px wide. A click on the image opens all slides full-screen, unless href or onClick is set.

Loading examples…

PropTypeDescription
align"start" | "center" | "end" | "baseline" | "stretch"
justify"start" | "center" | "end" | "spaceBetween" | "spaceAround" | "spaceEvenly" | "stretch"
wrap"nowrap" | "wrap" | "wrap-reverse"
gapnumber | string4px steps when a number
rowGapnumber | string
columnGapnumber | string
paddingnumber | string4px steps when a number
backgroundstringOne of surface|surface-secondary|surface-tertiary|surface-elevated|surface-elevated-secondary|surface-inverted|surface-soft|info|warning|caution|success|danger|discovery|info-solid|warning-solid|caution-solid|success-solid|danger-solid|discovery-solid or a CSS color. Leave it unset. Only one summary panel in a Card can use "surface-secondary"
borderboolean
borderColor"default" | "subtle" | "strong" | "info" | "warning" | "caution" | "success" | "danger" | "discovery"
radius"2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "full" | number | string | object
widthnumber | string
heightnumber | string
minWidthnumber | string
maxWidthnumber | string
minHeightnumber | string
maxHeightnumber | string
flexnumber
weightnumberflex-grow in a Row or Column
aspectRatiostringDefault "4 / 3"
scrollableboolean
clipboolean
shadowboolean
inlineboolean
rolestringARIA role
flushbooleanNo padding
minSizenumber | stringMinimum width and height
maxSizenumber | stringMaximum width and height
disableAutoSpacingbooleanNo default gap between children
urlstringImage URL
descriptionstringWhat the image shows, for screen readers
size"sm" | "md" | "lg"The width: "sm" 160px, "md" 240px, "lg" 320px. Default "md"
hrefstringOpens this URL in a new tab
lightboxbooleanDefault true: a click opens all slides full-screen

Slots

  • children · multiple

Events

  • onVisible · Sent once, the first time the container scrolls into view. Use it to load more content lazily.
  • onClick · Sent when the user clicks the image. It replaces the full-screen view.

Link to Carousel · All standard components