Carousel
Sliding window component for cycling through a set of items, with pagination dots, optional progress bar, auto-play interval and keyboard navigation.
Aperçu
Rendu de l’aperçu en cours…
defaultRendu de l’aperçu en cours…
no arrowsRendu de l’aperçu en cours…
vertical dotsStructure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
Emplacements de contenu exposés par ce composant.
- #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
Événements émis par ce composant.
- @update:modelValueany
- Fired when the active slide changes. Carries the new slide value.
API
Membres exposés
Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.
- <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.
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- 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
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Rôles ARIA
Interactions clavier
| Touche | 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.
Fondation
Design tokens
Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.
- 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.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Basic carousel
Auto-play with progress
Custom slide content
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.