ListGroup
Collapsible group inside a List. Renders a header activator and a nested items container that expands/collapses with an animated transition.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<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
All props accepted by this component, with their type, default value and 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
Content slots exposed by this component.
- #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
Events emitted by this component.
- @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
Exposed members
Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.
- 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.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- 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
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | 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.
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.
- 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.
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.
Collapsible group
Custom activator
Ecosystem
Family
Components from the same folder that share conventions and often compose together.