Slide
Horizontally scrollable slide group with drag scroll, keyboard navigation and optional arrow controls.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-slide-group> — 4 internal parts: root container ①, prev affix ②, scrollable container ③, next affix ④.- 1.origam-slide-group
- Root flex container. Clips overflow to hide off-screen items.
- 2.origam-slide-group__prev
- Previous arrow affix. Rendered only when showArrows is active. Hosts the #prev slot or a default OrigamIcon.
- 3.origam-slide-group__container
- Scrollable viewport. overflow: hidden with scroll event handling for arrow state.
- 4.origam-slide-group__next
- Next arrow affix. Rendered only when showArrows is active. Hosts the #next slot or a default OrigamIcon.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- centerActivebooleanfalse
- When true, the active item is scrolled to the center of the container.
- Icon for the "next" navigation arrow.
- Icon for the "previous" navigation arrow.
- showArrowsboolean | 'always'false
- Controls arrow visibility. false = hidden, true = shown when needed, 'always' = always visible.
- tagstring'div'
- HTML element rendered at the root.
- Scroll axis. horizontal (default) or vertical.
- modelValuestring | number | string[] | number[]
- The currently selected item value (or array for multi-select). Synced via v-model.
- multiplebooleanfalse
- Allows multiple items to be selected simultaneously.
- displayLevel
- Responsive breakpoint below which the component is hidden.
- borderboolean | stringfalse
- Applies a border to the slide group container.
- rounded
- Border-radius token or boolean.
API
Slots
Emplacements de contenu exposés par ce composant.
- #default
- Container for slide items. Slot props expose selection helpers for child items.
- #prev
- Replaces the previous arrow button with custom content.
- #next
- Replaces the next arrow button with custom content.
API
Emits
Événements émis par ce composant.
- @update:modelValuestring | number | string[] | number[]
- Emitted when the selected item changes. Syncs with v-model.
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.
- 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.
- Root display mode.
- Root overflow clipping.
- Scroll animation duration.
- Minimum width of the prev/next arrow affixes.
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 |
|---|---|
| Arrow Left / Right | Moves focus between items inside the scroll container. |
| Tab | Focuses the slide group container, then Tab moves through items. |
| Home / End | Jumps focus to the first or last item. |
Notes
- The scroll container is keyboard-accessible. Arrow keys trigger programmatic scrollTo calls for cross-browser scroll support.
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.
- otherflex
- Root display mode.
- otherhidden
- Root overflow.
- duration{motion.duration.medium}
- Scroll transition duration.
- dimension52px
- Minimum width of the prev/next arrow affixes.
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 slide group
With selection
Always show arrows