Carousel
Sliding window component for cycling through a set of items, with pagination dots, optional progress bar, auto-play interval and keyboard navigation.
Preview
Rendering the live preview…
defaultRendering the live preview…
no arrowsRendering the live preview…
vertical dotsStructure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-carousel> — 5 internal parts.- 1.origam-carousel
- Root element. Delegates slide rendering to an inner OrigamWindow.
- 2.origam-carousel__controls
- Absolute strip at the bottom. Contains the delimiter (dot) buttons. Hidden when hideDelimiters=true.
- 3.origam-carousel__controls-item
- One pagination dot — an OrigamBtn rendered per slide. Gets --active modifier when its slide is selected.
- 4.origam-carousel__controls-item--active
- BEM modifier applied to the active dot. Icon opacity rises from 0.5 to 1.
- 5.origam-carousel__progress
- Absolute strip at the top. Wraps OrigamProgressLinear. Visible only when progress=true.
API
Props
All props accepted by this component, with their type, default value and description.
- cyclebooleanfalse
- Enables automatic slide cycling. Uses the interval prop to control timing.
- Icon rendered inside each pagination dot button.
- hideDelimitersbooleanfalse
- Hides the pagination dot bar entirely.
- hideDelimiterBackgroundbooleanfalse
- Removes the semi-transparent background from the pagination dot strip.
- intervalnumber | string6000
- Auto-play interval in milliseconds. Only active when cycle=true.
- progressbooleanfalse
- Displays a thin progress bar at the top that fills over the interval duration. Resets on each slide change.
- verticalDelimitersboolean | TInlinefalse
- Renders the pagination dots vertically on the left or right edge.
- continuousbooleantrue
- Allows wrapping around from the last item to the first and vice versa.
- nextIconTIcon
- prevIconTIcon
- reverseboolean
- showArrowsstring | booleantrue
- Shows prev/next navigation arrows. Pass 'hover' to show only on pointer hover.
- touchboolean | ITouchHandlers
- modelValueany
- Currently active slide value. Use with v-model for two-way binding.
- disabledboolean
- selectedClassstring
- mandatorybooleantrue
- Keeps at least one slide selected at all times.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- tagstring
- directionTDirection'horizontal'
- Slide transition direction. horizontal or vertical.
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- roundedboolean | number | string | TRounded | null | undefined
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- elevationTElevation
- bgColor
- Background color applied to the pagination dot strip (controls area).
- hoverboolean | IStateEffectConfig
- Surface applied to pagination dots on pointer hover.
- hoverClassstring
- activeboolean | IStateEffectConfig
- Surface applied to the active pagination dot. Pass an object for customised state styling.
- activeClassstring
- color
- Active dot color intent.
- heightnumber | string500
- Height of the carousel in pixels or a CSS length.
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- Explicit width override.
API
Slots
Content slots exposed by this component.
- #default
- Container for OrigamCarouselItem elements. Receives group context from OrigamWindow.
- #additional
- Renders after the slide content area. By default contains the pagination dots and progress bar. Replace to take full control.
- #item
- Replaces all pagination dot buttons at once. Receives props (bind to trigger), item and index.
- #item.{index}
- Replaces the pagination dot at position {index}. Useful for custom per-slide indicators.
- #progress
- Replaces the auto-play progress bar. Receives percent (0–100).
- #play-pause
- #prev
- Replaces the previous-slide arrow button.
- #next
- Replaces the next-slide arrow button.
- #arrows
- Replaces both navigation arrows in one go. Useful to lay them out differently.
API
Emits
Events emitted by this component.
- @update:modelValueany
- Fired when the active slide changes. Carries the new slide value.
API
Exposed members
Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.
- <T extends object>(props: T, exclude?: string[]) => Partial<T>
- Utility to forward a filtered subset of props to a child component.
- Ref<string>
- Reactive CSS string generated by useStyle from the computed carousel styles.
- string
- Unique style-sheet ID for this instance.
- () => void
- Injects the computed style sheet into the document.
- () => void
- Removes the injected style sheet.
- Ref<boolean>
- True once the style sheet has been injected into the DOM.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- Overflow mode of the carousel root.
- CSS position of the root element.
- Root width.
- Background of the pagination dots strip.
- Height of the controls strip.
- Z-index of the controls strip, ensuring it renders above slide content.
- Default icon opacity inside a pagination dot.
- Icon opacity inside the active pagination dot.
- Top offset of the progress bar. Set to auto and provide bottom to move it.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | Action |
|---|---|
| ArrowLeft / ArrowRight | Navigates to the previous or next slide when focused on the carousel. |
| Tab | Moves focus through pagination dots and navigation arrows. |
| Enter / Space | Activates the focused pagination dot or arrow button. |
Notes
- Each pagination dot receives aria-label="Slide N of M" via useLocale t() — screen readers announce position.
- Auto-play is suppressed when prefers-reduced-motion: reduce is detected (prefersReducedMotion() check on mount).
- The slide timer is cleared on unmount and restarted on modelValue change, but there is no explicit pause-on-focus — consider disabling cycle for keyboard-heavy contexts.
Foundation
Design tokens
Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.
- colorrgba(0, 0, 0, 0.4)
- Dot strip background. Transparent when hideDelimiterBackground=true.
- dimension50px
- Height of the pagination dot strip.
- numbervar(--origam-opacity---50)
- Icon opacity inside inactive dots.
- numbervar(--origam-opacity---100)
- Icon opacity inside the active dot.
- durationvar(--origam-motion__duration---slow)
- Slide transition duration.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Basic carousel
Auto-play with progress
Custom slide content
Ecosystem
Family
Components from the same folder that share conventions and often compose together.