ItemGroup
Renderless selection container that tracks which child OrigamItem elements are selected. Single, multiple and mandatory selection modes.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-item-group> — renderless root (①) wrapping child <origam-item> elements (②③). The selected item carries the selectedClass.- 1.origam-item-group
- Root element. Renderless — no visual chrome. Provides group context via
ORIGAM_ITEM_GROUP_KEY. - 2origam-item (unselected)
- Child item not currently selected. Exposes
isSelected=falseto its default slot. - 3origam-item (selected)
- Child item that is currently selected. Receives
selectedClassand exposesisSelected=true.
API
Props
All props accepted by this component, with their type, default value and description.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- tagstring'div'
- Root HTML element tag.
- disabledbooleanfalse
- Disables all items in the group.
- modelValueany
- Currently selected item value(s). Bind with v-model.
- multiplebooleanfalse
- Allows multiple items to be selected at once.
- mandatorybooleanfalse
- Forces at least one item to remain selected. Deselecting the last item is ignored.
- maxnumber
- Maximum number of simultaneously selected items (multiple mode only).
- selectedClassstring'origam-item--selected'
- CSS class injected on each OrigamItem when it is selected. Propagated down via OrigamDefaultsProvider.
API
Slots
Content slots exposed by this component.
- #default
- Default slot. Exposes group selection helpers: isSelected(id), select(id, value), next(), prev(), selected (read-only ref).
API
Emits
Events emitted by this component.
- @update:modelValueany
- Emitted when the selected item(s) change. Carries the new value or array of values.
API
Exposed members
Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.
- <T extends object>(props: T, exclude?: string[]) => Partial<T>
- Utility to forward a filtered subset of props to a child.
- () => void
- Selects the next item in DOM order.
- () => void
- Selects the previous item in DOM order.
- (id: number, value: boolean) => void
- Programmatically toggle the selected state of an item by its internal id.
- Ref<string>
- Reactive CSS string generated by useStyle.
- string
- Unique style-sheet ID for this instance.
- () => void
- Injects the computed style sheet. Called automatically on mount.
- () => void
- Removes the injected style sheet. Called automatically on unmount.
- Ref<boolean>
- True once the style sheet has been injected into the DOM.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Moves focus through the child items. Keyboard navigation is delegated to the rendered child elements (e.g. origam-btn with role="button"). |
Notes
- OrigamItemGroup is renderless and carries no ARIA role itself. Consumers must ensure the rendered children have appropriate roles (button, tab, radio, etc.).
- The selectedClass is injected as a CSS class — not an ARIA attribute. Consumers are responsible for mapping the selected state to aria-pressed, aria-selected or aria-checked on their child elements.
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.
Single selection
Multiple selection
Ecosystem
Family
Components from the same folder that share conventions and often compose together.