Item
Layout & Structure
stable
Renderless selection item that registers itself in an ItemGroup and exposes its selected state via the default slot.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-item> — 2 parts: the root element that carries the selected class, and the default slot that receives the group item state.- 1.origam-item
- Root element. Applies the
selectedClasswhen the item is selected. Rendered as<div>by default (configurable viatag). - 2.origam-item #default
- Default slot. Receives
{ isSelected, selectedClass, toggle, select, value, disabled }so the consumer can wire any visual element to the selection state.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- tagstring'div'
- HTML element rendered at the root.
- valueany
- The value this item represents. Used by ItemGroup to track selection via modelValue.
- disabledbooleanfalse
- Prevents the item from being selected. The group still registers it but toggle() is a no-op.
- selectedClassstring
- CSS class applied to the root element when this item is selected. Overrides the group-level selectedClass.
API
Slots
Emplacements de contenu exposés par ce composant.
- #default
- Default slot receiving the item state. isSelected (boolean), toggle () => void, select (value: boolean) => void, value (any), disabled (boolean).
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>
- Utility to forward a filtered subset of props to a child component.
- () => void
- Toggles the item selection state. Equivalent to calling groupItem.toggle() from the default slot.
- Ref<string>
- Reactive CSS string generated by useStyle. Used by OrigamDefaultsProvider to inject styles.
- string
- Unique style-sheet ID for this instance.
- () => void
- Injects the computed style sheet into the document. 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
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Notes
- OrigamItem is renderless — it applies no ARIA attributes itself. The consumer is responsible for adding role, aria-selected, aria-disabled and keyboard handling to the slot content.
- Must be used inside an <origam-item-group>. Throws a runtime error otherwise.
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Single-select group
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.