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
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<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
All props accepted by this component, with their type, default value and 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
Content slots exposed by this component.
- #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
Events emitted by this component.
- @update:modelValueany
- Fired when the active slide changes.
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.
- 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.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- 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
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | 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.
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.
- 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.
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 window
Vertical direction
Continuous (wrap-around)
Ecosystem
Family
Components from the same folder that share conventions and often compose together.