Skip to content

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 / arrows slots 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 ​

SlotSlot propsDescription
defaultgroupWhere you nest <OrigamWindowItem> children. The bound group exposes prev, next, select, selected.
prevprops, canMoveOverride the prev affordance. Spread props on a custom button.
nextprops, canMoveOverride the next affordance.
arrowsprevProps, nextProps, canMoveBack, canMoveForwardReplace both controls in one slot.
additionalgroupSlot 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.

PropTypeDefaultDescription
modelValueany—v-model — the value of the active <OrigamWindowItem>.
continuousbooleanfalseWraps 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.
prevIconTIconmdi-chevron-leftIcon of the previous-slide button.
nextIconTIconmdi-chevron-rightIcon of the next-slide button.
reversebooleanfalseInverts the transition direction, so forward navigation animates as if it were backward.
showArrowsboolean | 'hover'truefalse hides the controls block entirely; 'hover' keeps it mounted but translates the arrows out of view until the window is hovered.
touchboolean | ITouchHandlersundefinedfalse disables swipe navigation. An object merges your handlers over the built-in left/right ones.
disabledbooleanfalseFreezes selection — forwarded to the underlying group.
selectedClassstring'origam-window-item--active'Class applied to the active item by the group registry.
mandatorybooleantrueKeeps 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 variableDefault
--origam-window---overflowhidden
--origam-window---transition-duration{motion.duration.slow}
--origam-window---transition-easing{motion.easing.standard}
--origam-window__container---displayflex
--origam-window__container---flex-directioncolumn
--origam-window__controls---padding-inline{space.4}
--origam-window__controls---color{color.text.primary}
--origam-window--show-arrows-on-hover---prev-transformtranslateX(-200%)
--origam-window--show-arrows-on-hover---next-transformtranslateX(200%)
--origam-window--show-arrows-on-hover---hover-transformtranslateX(0)

Accessibility ​

  • Name it, and you get the landmark. Pass an aria-label (or an aria-labelledby) — it falls through to the root automatically — and the root then carries role="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: region is 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 an aria-roledescription describing 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 defect OrigamCode'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-label from the locale (default origam.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 programmatic v-model navigation.
  • The active item is the only one rendered in the DOM transition phase; screen readers see one slide at a time.
  • Pair direction="horizontal" with prefers-reduced-motion and bind :transition="false" on items if the user opted out of motion.
  • OrigamWindowItem — the slide primitive consumed by <OrigamWindow>.