SelectionControlGroup
Groups multiple SelectionControl instances under a shared v-model with inline layout support and a typed item-slot API.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
Emplacements de contenu exposés par ce composant.
- #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
Événements émis par ce composant.
- @update:modelValueany
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>
- 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.
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.
- 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
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 |
|---|---|
| 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.
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
- Display mode for the group container.
- othercolumn
- Default stack direction (column). Row when inline.
- dimensionvar(--origam-space---2)
- Gap between child controls.
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.
Checkbox group
Radio group inline
Disabled group
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.