ListGroup
Collapsible group inside a List. Renders a header activator and a nested items container that expands/collapses with an animated transition.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-list-group> — 3 primary zones: root ①, activator wrapper ②, and the collapsible items container ③ with an animated OrigamExpandY transition.- 1.origam-list-group
- Root element. Carries modifier classes:
--prepend,--append,--fluid,--open. Usesv-contrastdirective for automatic contrast correction. - 2.origam-list-group__activator
- OrigamListGroupActivator wrapper around the header slot. Registers the activator context for nested group detection (
useNestedGroupActivator). - 3.origam-list-group__items
- Collapsible container. Rendered only when
isOpenis true (v-if). Wrapped inOrigamExpandYfor enter/leave animation. Setsrole="group"andaria-labelledbypointing to the activator id.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- Icon shown in the activator when the group is expanded.
- Icon shown in the activator when the group is collapsed.
- fluidbooleanfalse
- Removes the nested indent (list-indent-size = 0). Useful for flat-hierarchy navigation drawers.
- titlestring
- Title text rendered inside the default activator ListItem.
- valueany
- Value used by the nested item system to track the open/closed state. Required when using nested or controlled open state.
- tagstring'div'
- HTML element rendered at the root of the list group.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- color
- Foreground color inherited by all descendant ListItems via OrigamDefaultsProvider.
- bgColor
- Background color inherited by all descendant ListItems via OrigamDefaultsProvider.
- 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
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>false
- Applies a border to the group root.
- 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
- Border-radius token applied to the group root.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- appendAvatarstring
- appendIcon
- Icon forwarded as appendIcon to the default activator ListItem. Overrides the toggle icon when set.
- prependAvatarstring
- prependIcon
- Icon forwarded as prependIcon to the default activator ListItem.
- prependAriaLabelstring
- appendAriaLabelstring
- activeClassstring
- hoverboolean | IStateEffectConfig
- hoverClassstring
API
Slots
Emplacements de contenu exposés par ce composant.
- #default
- Full override of both the activator and the items container. When used, the activator and items slots are ignored.
- #activator
- Custom activator element. Receives events (click handler), props (id + class), isOpen (boolean), toggleIcon (TIcon).
- #items
- Items rendered inside the collapsible zone below the activator.
API
Emits
Événements émis par ce composant.
- @click:activator{ open: boolean; event: Event }
- Fired when the user clicks the activator header. Carries the raw MouseEvent. The group toggles its own open state; this emit is for external listeners.
API
Membres exposés
Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.
- Ref<boolean>
- Reactive ref reflecting whether the group is currently expanded.
- <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.
- ComputedRef<string>
- Computed unique ID used for aria-labelledby on the items container.
- () => 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.
- Amount by which nested items are indented. Set to 0 by --fluid modifier.
- Width of the prepend area accounted for in the nested indent calculation.
- Cumulative indent from parent groups. Grows with each nesting level.
- Overlay opacity of the activator item when the group is open. Defaults to 0 (no tint on active header).
- Overlay opacity on hover when the activator is in active/open state. A scoped calc (0.04 * 1) is applied in the component SCSS.
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 |
|---|---|
| Enter / Space | Activates the activator ListItem and toggles the group open/closed. |
| Tab | Moves focus through the activator and then the expanded items. |
Notes
- The items container carries role="group" and aria-labelledby pointing to the activator element id, so screen readers announce the group name when entering the nested list.
- The v-contrast directive automatically adjusts the foreground color for sufficient contrast against the bgColor.
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.
- dimensionvar(--origam-space---4)
- Default indentation per nesting level.
- dimensionvar(--origam-space---4)
- Prepend area width added to the indent calculation when a prepend zone is present.
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.
Collapsible group
Custom activator
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.