Appearance
OrigamWindow
<OrigamWindow> is a carousel-style stack: only one of its children (<OrigamWindowItem>) is shown at a time and prev/next controls move through the stack with a directional transition. Selection is owned by useGroup so the active value can be controlled or two-way bound via v-model.
Basic usage
vue
<template>
<OrigamWindow v-model="step">
<OrigamWindowItem :value="1">Step 1</OrigamWindowItem>
<OrigamWindowItem :value="2">Step 2</OrigamWindowItem>
<OrigamWindowItem :value="3">Step 3</OrigamWindowItem>
</OrigamWindow>
</template>
<OrigamWindowItem>MUST be nested inside<OrigamWindow>— it consumes the group context. The component throws on mount otherwise.
Direction
direction toggles the transition axis. Horizontal slides items left / right (default), vertical slides them up / down. Combine with reverse to invert the geometric direction without affecting selection logic.
vue
<template>
<OrigamWindow direction="horizontal">…</OrigamWindow>
<OrigamWindow direction="vertical">…</OrigamWindow>
<OrigamWindow direction="horizontal" reverse>…</OrigamWindow>
</template>Continuous
continuous makes the carousel wrap: hitting prev on the first item loops to the last, and vice-versa. Without it, prev / next are disabled at the edges (and the corresponding control is hidden).
vue
<template>
<OrigamWindow continuous v-model="step">…</OrigamWindow>
</template>Show arrows
showArrows accepts true, false, or 'hover'. The hover mode keeps the arrows offscreen until the user hovers the window (driven entirely by CSS — --origam-window--show-arrows-on-hover---*-transform).
vue
<template>
<OrigamWindow show-arrows>…</OrigamWindow>
<OrigamWindow :show-arrows="false">…</OrigamWindow>
<OrigamWindow show-arrows="hover">…</OrigamWindow>
</template>Custom icons
prevIcon / nextIcon swap the default chevrons. Pass any value the icon system accepts (an mdi-* string, a component, etc.).
vue
<template>
<OrigamWindow prev-icon="mdi-arrow-left" next-icon="mdi-arrow-right">…</OrigamWindow>
</template>Arrow surface — bgColor, hover, active
bgColor, hover / hoverClass and active / activeClass are NOT painted on the window root: they are forwarded verbatim to the two default <OrigamBtn> prev / next controls. Use them to tune the affordances without replacing them through the prev / next / arrows slots.
hover and active follow the usual grammar of IHoverProps / IActiveProps — true forces the state on, an IStateEffectConfig object overrides the resting color / bgColor / border / rounded / elevation / padding / margin / gap only while the state is engaged.
vue
<template>
<OrigamWindow bg-color="primary" show-arrows>…</OrigamWindow>
<OrigamWindow :hover="{ bgColor: 'primary' }" show-arrows>…</OrigamWindow>
<OrigamWindow active-class="my-pressed-arrow" show-arrows>…</OrigamWindow>
</template>Because these props reach the buttons only, they have no effect when the
prev/next/arrowsslots replace the default controls.
Touch
touch enables (or replaces) the swipe handlers. Pass false to disable, true to use the defaults (left = next, right = prev), or an object overriding individual handlers from ITouchHandlers.
vue
<template>
<OrigamWindow :touch="false">…</OrigamWindow>
<OrigamWindow touch>…</OrigamWindow>
</template>Slots
| Slot | Slot props | Description |
|---|---|---|
default | group | Where you nest <OrigamWindowItem> children. The bound group exposes prev, next, select, selected. |
prev | props, canMove | Override the prev affordance. Spread props on a custom button. |
next | props, canMove | Override the next affordance. |
arrows | prevProps, nextProps, canMoveBack, canMoveForward | Replace both controls in one slot. |
additional | group | Slot rendered AFTER the container — useful for pagination dots. |
Props
Own props. The cross-cutting surfaces (rounded, border, elevation, padding, margin, bgColor, hover, active, tag, direction, id, class, style) come from the extends chain below and behave as they do everywhere else in the DS.
| Prop | Type | Default | Description |
|---|---|---|---|
modelValue | any | — | v-model — the value of the active <OrigamWindowItem>. |
continuous | boolean | false | Wraps around: the last slide's next goes back to the first, and the first slide's prev to the last. Both arrows then stay reachable at every index. |
prevIcon | TIcon | mdi-chevron-left | Icon of the previous-slide button. |
nextIcon | TIcon | mdi-chevron-right | Icon of the next-slide button. |
reverse | boolean | false | Inverts the transition direction, so forward navigation animates as if it were backward. |
showArrows | boolean | 'hover' | true | false hides the controls block entirely; 'hover' keeps it mounted but translates the arrows out of view until the window is hovered. |
touch | boolean | ITouchHandlers | undefined | false disables swipe navigation. An object merges your handlers over the built-in left/right ones. |
disabled | boolean | false | Freezes selection — forwarded to the underlying group. |
selectedClass | string | 'origam-window-item--active' | Class applied to the active item by the group registry. |
mandatory | boolean | true | Keeps exactly one item selected: the group refuses to end up with an empty selection. |
Props (interface)
ts
interface IWindowProps extends ICommonsComponentProps, ITagProps,
IDirectionProps, IBorderProps, IPaddingProps, IMarginProps,
IRoundedProps, IElevationProps, IBgColorProps, IHoverProps,
IActiveProps {
continuous?: boolean
nextIcon?: TIcon
prevIcon?: TIcon
reverse?: boolean
showArrows?: string | boolean
touch?: boolean | ITouchHandlers
modelValue?: any
disabled?: boolean
selectedClass?: string
mandatory?: boolean
}Anatomy
html
<div class="origam-window">
<div class="origam-window__container">
<slot/>
<div class="origam-window__controls">
<button class="origam-window__prev"/>
<button class="origam-window__next"/>
</div>
</div>
</div>Design tokens consumed
Defined in packages/ds/src/assets/css/tokens/light.css and dark.css (SCSS twins under packages/ds/src/assets/scss/tokens/).
| CSS variable | Default |
|---|---|
--origam-window---overflow | hidden |
--origam-window---transition-duration | {motion.duration.slow} |
--origam-window---transition-easing | {motion.easing.standard} |
--origam-window__container---display | flex |
--origam-window__container---flex-direction | column |
--origam-window__controls---padding-inline | {space.4} |
--origam-window__controls---color | {color.text.primary} |
--origam-window--show-arrows-on-hover---prev-transform | translateX(-200%) |
--origam-window--show-arrows-on-hover---next-transform | translateX(200%) |
--origam-window--show-arrows-on-hover---hover-transform | translateX(0) |
Accessibility
- Name it, and you get the landmark. Pass an
aria-label(or anaria-labelledby) — it falls through to the root automatically — and the root then carriesrole="region"+aria-roledescription="carousel", the WAI-ARIA Authoring Practices carousel pattern. - Don't name it, and there is no landmark at all. Since #781 the DS no longer declares a role it cannot name:
regionis one of the roles whose WAI-ARIA 1.2 definition marks the accessible name as required, so an unnamed one is not a navigable landmark — just a nameless entry in the landmark list, with anaria-roledescriptiondescribing nothing. A dev-only console warning (silent in production builds) says exactly this and names the attribute to add. No default label is invented: "Carousel" on every instance would make several carousels on one page indistinguishable, the same defectOrigamCode's scroller was corrected for. - The roledescription text comes from the locale (
origam.carousel.role_description) — screen readers read it verbatim, so it is never a hardcoded English string. - Prev / next buttons receive an
aria-labelfrom the locale (defaultorigam.carousel.prev/origam.carousel.next). - A visually-hidden
role="status"/aria-live="polite"live region announces the active slide (origam.carousel.aria_label.delimiter, e.g. "Carousel slide 2 of 3") whenever it changes — via the prev/next buttons, a swipe, or programmaticv-modelnavigation. - The active item is the only one rendered in the DOM transition phase; screen readers see one slide at a time.
- Pair
direction="horizontal"withprefers-reduced-motionand bind:transition="false"on items if the user opted out of motion.
Related
OrigamWindowItem— the slide primitive consumed by<OrigamWindow>.