SelectionControlGroup
Groups multiple SelectionControl instances under a shared v-model with inline layout support and a typed item-slot API.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-selection-control-group> — root group ① wraps SelectionControl children ② via OrigamDefaultsProvider. The item slot ③ controls how each item is rendered.- 1.origam-selection-control-group
- Root div with role="group". Receives the group id as the ARIA id attribute. Applies --inline modifier when inline=true.
- 2.origam-selection-control-group--inline
- Modifier applied when inline=true. Switches flex-direction from column to row.
- 3[slot: item / item.{index}]
- Items slot rendered per entry in the items array. Wrapped in OrigamDefaultsProvider so group-level props (color, type, density, disabled…) are inherited by children.
API
Props
All props accepted by this component, with their type, default value and description.
- disabledbooleanfalse
- Disables every child SelectionControl in the group.
- errorstring | booleanfalse
- Puts every child in error state (danger color).
- inlinebooleanfalse
- Switches the group from column (default) to row layout via the --inline modifier class.
- falseIcon
- Icon shown when a child control is unchecked/false. Forwarded to all children.
- trueIcon
- Icon shown when a child control is checked/true. Forwarded to all children.
- multipleboolean
- Enables multi-selection. When true, modelValue is treated as an array.
- namestring
- Name attribute forwarded to every child SelectionControl. Auto-generated when absent.
- readonlybooleanfalse
- Makes every child SelectionControl read-only.
- modelValueany
- Shared v-model value. Provided down to every SelectionControl child via ORIGAM_SELECTION_CONTROL_GROUP_KEY.
- typestring
- Native input type forwarded to every child SelectionControl. Usually "checkbox" or "radio".
- valueComparator(a: any, b: any) => boolean
- Custom equality function for comparing values when modelValue is non-primitive.
- itemsArray<any> | Record<string, any>[]
- Array or record of items rendered via the item slot. Each item is available as slot binding.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- color
- Intent or custom color forwarded to every child SelectionControl.
- tagstring'div'
- Root HTML element. Default is div. The root always has role="group".
- Density forwarded to every child control.
- rippleboolean | { class: string }true
- Enables Material ripple effect forwarded to every child control.
API
Slots
Content slots exposed by this component.
- #default
- Full override of the group content. Receives the items array. When not provided, the group iterates over items using the item slot.
- #item
- Template for each item in the items array. Receives item data and index.
- #item.{index}
- Per-index item slot override. Takes precedence over the generic item slot for that specific index.
API
Emits
Events emitted by this component.
- @update:modelValueany
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>
- Forwards a filtered subset of props to child components.
- Ref<string>
- Reactive CSS string generated by useStyle.
- ComputedRef<string>
- Computed group id (props.id or auto-generated origam-selection-control-group-{uid}).
- string
- Unique style-sheet ID for this instance (distinct from the logical group id).
- () => 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.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- Display mode for the group container (always flex).
- Stack direction. Switches to row when --inline modifier is applied.
- Flex direction when inline=true.
- Wrap mode for inline groups.
- Gap between child SelectionControl items.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Moves focus through each child SelectionControl. |
| Space | Toggles the focused child control. |
Notes
- The root element carries role="group" and is identified by the computed name/id attribute. Screen readers announce the group boundary.
- OrigamDefaultsProvider forwards type, name, density, color, disabled, readonly and error to every descendant SelectionControl. Child overrides still win.
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.
- otherflex
- Display mode for the group container.
- othercolumn
- Default stack direction (column). Row when inline.
- dimensionvar(--origam-space---2)
- Gap between child controls.
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.
Checkbox group
Radio group inline
Disabled group
Ecosystem
Family
Components from the same folder that share conventions and often compose together.