Window
Slide-based content switcher with previous/next navigation, touch swipe, keyboard support and configurable transitions. The base for Carousel, Stepper and Tab panels.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-window> — 5 internal parts. The root ① wraps the container ② which holds the active WindowItem ③. Prev ④ and next ⑤ arrow buttons overlay the container sides.- 1.origam-window
- Root element. position: relative; overflow: hidden. Receives tag, rounded, elevation and bgColor.
- 2.origam-window__container
- Inner flex column. display: flex; flex-direction: column; height: inherit. Hosts the #default slot (WindowItem children).
- 3origam-window-item
- Each slide — rendered inside OrigamWindowItem. Only the active item is visible; transitions are handled by OrigamTransition wrapping each item.
- 4.origam-window__controls [prev]
- Previous arrow button. Absolute-positioned on the left/top edge. Hidden when showArrows=false or canMoveBack=false.
- 5.origam-window__controls [next]
- Next arrow button. Absolute-positioned on the right/bottom edge.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- continuousbooleanfalse
- When true, the prev/next navigation wraps around (first ↔ last).
- Icon for the next button. Override for custom iconography.
- Icon for the prev button.
- reversebooleanfalse
- Reverses the slide direction. Useful for RTL or countdown-style sequences.
- showArrowsstring | booleanfalse
- Controls arrow visibility: false=hidden, true=always shown, "hover"=shown on hover.
- touchboolean | ITouchHandlerstrue
- Enable touch swipe to navigate. Pass an ITouchHandlers object to override left/right/up/down handlers.
- modelValueany
- v-model for the currently active slide. Matches the value prop of the active WindowItem.
- disabledbooleanfalse
- Disables navigation (arrows and keyboard). The active slide remains visible.
- selectedClassstring'origam-window-item--active'
- CSS class applied to the currently active WindowItem.
- mandatorybooleanfalse
- When true, always keeps at least one item selected (deselect is not allowed).
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- tagstring
- Slide animation axis: horizontal (default) 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
- Border-radius token applied to the window wrapper.
- 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
- Box-shadow elevation applied to the window wrapper.
- bgColor
- Background color applied to the arrow buttons.
- hoverboolean | IStateEffectConfigfalse
- Forces the hover state on the arrow buttons.
- hoverClassstring
- activeboolean | IStateEffectConfigfalse
- Forces the active state (forwarded to arrow buttons).
- activeClassstring
API
Slots
Emplacements de contenu exposés par ce composant.
- #default
- Slide content. Place OrigamWindowItem children here. Receives the group provide context.
- #arrows
- Full replacement for both prev and next buttons. Receives the bound props and canMove flags.
- #prev
- Replaces only the previous button. Receives bound props and canMove boolean.
- #next
- Replaces only the next button.
- #additional
- Slot rendered after the container (outside the slide stack). Useful for indicator dots or progress bars that must not clip with the content.
API
Emits
Événements émis par ce composant.
- @update:modelValueany
- Fired when the active slide changes.
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.
- GroupProvide
- Group selection context provided to all WindowItem children. Used to wire the active state.
- Ref<string>
- Reactive CSS string for computed styles.
- string
- Unique style-sheet ID.
- () => void
- Injects the style sheet on mount.
- () => void
- Removes the style sheet on unmount.
- Ref<boolean>
- True once the style sheet has been injected.
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 of the root element (hidden to clip exiting slides).
- Slide transition duration.
- Easing function for slide transitions.
- Icon color of the arrow buttons.
- Arrow button icon color on hover.
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 | Navigate to the previous/next slide when direction="horizontal". |
| ArrowUp / ArrowDown | Navigate to the previous/next slide when direction="vertical". |
| Tab | Moves focus through arrow buttons and content inside the active slide. |
Notes
- Consider adding role="region" and aria-label to the window to make the slide region identifiable to screen readers.
- Arrow buttons are OrigamBtn with icon props — always provide aria-label (e.g. "Previous slide", "Next slide") via the prevProps/nextProps slots.
- For auto-advancing windows (e.g. carousel), add aria-live="polite" on the active slide container so screen readers announce the new content.
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.
- durationvar(--origam-motion__duration---slow)
- Slide transition duration.
- cubicBeziervar(--origam-motion__easing---standard)
- Slide transition easing.
- colorvar(--origam-color__text---primary)
- Arrow button icon color.
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 window
Vertical direction
Continuous (wrap-around)
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.