Base component
Carousel
Theme-aware, responsive carousel component.
23 props1 slots10 outputsTheme readyResponsive
Interactive playground
Configure Carousel
Change any prop and inspect the server-rendered component immediately.
Live preview
page CarouselExample {
state items = [
{
"title": "A space to create",
"description": "Bring your next idea to life.",
"imageSrc": "/showcase-images/green-hero.svg"
},
{
"title": "Made for teamwork",
"description": "Keep everyone moving together.",
"imageSrc": "/showcase-images/blue-mountain.svg"
},
{
"title": "Room to grow",
"description": "Build something that matters.",
"imageSrc": "/showcase-images/violet-circle.svg"
}
]
view {
<Carousel
items="{items}"
showPagination="true"
showCounter="true"
ariaLabel="Product highlights"
/>
}
}
Event outputInteract with the preview to inspect the typed
payload.Live examples
Designed for real product surfaces
Compare configurations and resize the browser to check responsive behavior.
Recommended
01
Full-width, unframed
An edge-to-edge carousel without a card, border, or outer padding.
Live preview
page CarouselExample {
state items = [
{
"title": "A space to create",
"description": "Bring your next idea to life.",
"imageSrc": "/showcase-images/green-hero.svg"
},
{
"title": "Made for teamwork",
"description": "Keep everyone moving together.",
"imageSrc": "/showcase-images/blue-mountain.svg"
},
{
"title": "Room to grow",
"description": "Build something that matters.",
"imageSrc": "/showcase-images/violet-circle.svg"
}
]
view {
<Carousel
items="{items}"
showPagination="true"
showCounter="true"
ariaLabel="Product highlights"
/>
}
}
Compact
02
Framed gallery
Opt into a contained gallery when the surrounding layout needs it.
Live preview
page CarouselExample {
state items = [
{
"title": "A space to create",
"description": "Bring your next idea to life.",
"imageSrc": "/showcase-images/green-hero.svg"
},
{
"title": "Made for teamwork",
"description": "Keep everyone moving together.",
"imageSrc": "/showcase-images/blue-mountain.svg"
},
{
"title": "Room to grow",
"description": "Build something that matters.",
"imageSrc": "/showcase-images/violet-circle.svg"
}
]
view {
<Carousel
items="{items}"
showPagination="true"
showCounter="true"
ariaLabel="Product highlights"
framed="true"
/>
}
}
Advanced
03
Draggable slides
Move between slides with dragging, arrows, or pagination.
Live preview
page CarouselExample {
state items = [
{
"title": "A space to create",
"description": "Bring your next idea to life.",
"imageSrc": "/showcase-images/green-hero.svg"
},
{
"title": "Made for teamwork",
"description": "Keep everyone moving together.",
"imageSrc": "/showcase-images/blue-mountain.svg"
},
{
"title": "Room to grow",
"description": "Build something that matters.",
"imageSrc": "/showcase-images/violet-circle.svg"
}
]
view {
<Carousel
items="{items}"
showPagination="true"
isDraggable="true"
showCounter="true"
ariaLabel="Product highlights"
/>
}
}
Component outputs
Receive every typed component output
Use declarative output handlers in .wrn files or register a direct output handler from JavaScript. The canonical API exposes payload and does not require event.detail.
@initializeFires when the component emits the initialize event.@changeFires when the component's committed value or selection changes.@previousFires when the component emits the previous event.@nextFires when the component emits the next event.@playFires when the component emits the play event.@pauseFires when the component emits the pause event.@reachStartFires when the component emits the reachStart event.@reachEndFires when the component emits the reachEnd event.@dragStartFires when the component emits the dragStart event.@dragEndFires when the component emits the dragEnd event.<Carousel
@initialize='console.log(payload)'
@change='console.log(payload)'
@previous='console.log(payload)'
@next='console.log(payload)'
@play='console.log(payload)'
@pause='console.log(payload)'
@reachStart='console.log(payload)'
@reachEnd='console.log(payload)'
@dragStart='console.log(payload)'
@dragEnd='console.log(payload)'
/>import { registerOutputHandler } from "@wrnexus/csr/outputs"
const component = document.querySelector("[data-ui-component=\"Carousel\"], [data-component=\"Carousel\"]")
if (component) registerOutputHandler(component, "initialize", (payload) => {
console.log("initialize", payload)
})
if (component) registerOutputHandler(component, "change", (payload) => {
console.log("change", payload)
})
if (component) registerOutputHandler(component, "previous", (payload) => {
console.log("previous", payload)
})
if (component) registerOutputHandler(component, "next", (payload) => {
console.log("next", payload)
})
if (component) registerOutputHandler(component, "play", (payload) => {
console.log("play", payload)
})
if (component) registerOutputHandler(component, "pause", (payload) => {
console.log("pause", payload)
})
if (component) registerOutputHandler(component, "reachStart", (payload) => {
console.log("reachStart", payload)
})
if (component) registerOutputHandler(component, "reachEnd", (payload) => {
console.log("reachEnd", payload)
})
if (component) registerOutputHandler(component, "dragStart", (payload) => {
console.log("dragStart", payload)
})
if (component) registerOutputHandler(component, "dragEnd", (payload) => {
console.log("dragEnd", payload)
})Component API
Props and configuration
All content and behavior shown above is supplied through these props and slots.
| Prop | Type | Default | Required |
|---|---|---|---|
size | string | "default" | No |
color | string | "primary" | No |
title | string | "" | No |
description | string | "" | No |
items | unknown[] | [] | No |
activeIndex | number | 0 | No |
slidesPerView | number | 1 | No |
gap | string | "0.75rem" | No |
showPagination | boolean | false | No |
isAutoPlay | boolean | false | No |
autoplayInterval | number | 4000 | No |
isInfiniteLoop | boolean | false | No |
isRTL | boolean | false | No |
isCentered | boolean | false | No |
isDraggable | boolean | false | No |
isAutoHeight | boolean | false | No |
isSnap | boolean | false | No |
showCounter | boolean | false | No |
thumbnails | string | "none" | No |
ariaLabel | string | "Content carousel" | No |
framed | boolean | false | No |
variant | string | "default" | No |
class | string | "" | No |