Coral.mixin.selectionList is a mixin that adds selectable item support to a Coral component.

Coral.mixin.selectionList API

The selectionList mixin adds support for items and their selection to the host component.

Instance Properties

instance.items {Coral.Collection}

Readonly
The Collection Interface that allows interacting with the items that the component contains. See Coral.Collection for more details.

instance.multiple {Boolean}

Whether multiple items can be selected.
Default Value:
  • false
HTML Attribute:
  • multiple

instance.selectedItem {HTMLElement}

Readonly
Returns the first selected item in the selectionList. The value null is returned if no element is selected.

instance.selectedItems {Array.<HTMLElement>}

Readonly
Returns an Array containing the set selected items.

Coral.mixin.selectionList.Item API

The selectionList.Item mixes in features that are expected to be present on child elements of components that mixin selectionList.

Instance Properties

instance.disabled {Boolean}

Reflected
Whether this item is disabled. When set to true, this will prevent every user interaction with the item. If disabled is set to true for a selected item it will be deselected.
Default Value:
  • false
HTML Attribute:
  • disabled

instance.selected {Boolean}

Reflected
Whether the item is selected. Selected cannot be set to true if the item is disabled.
Default Value:
  • false
HTML Attribute:
  • selected