ui/Group

Exports the ui/Group.Group and ui/Group.GroupItem components. The default export is ui/Group.Group.

import Group from '@enact/ui/Group';

Members

GroupComponent

ui/Group.Group supports selection of its child items via configurable properties and events.

import Group from '@enact/ui/Group';
Properties
childComponent
Element

Component type to repeat. This can be a React component or a string describing a DOM node (e.g. 'div')

childProp
String

The property on each childComponent that receives the data in children

Default: 'children'
childSelect
String

The name of the event that triggers activation.

Default: 'onClick'
children
Array

An array of data to be mapped onto the childComponent. For example, an array of strings.

indexProp
String

The property on each childComponent that receives the index of the item

Default: 'data-index'
itemProps
Object

An object containing properties to be passed to each child.

onSelect
Function

Callback method to be invoked when an item is activated.

select
String

Selection mode for the group

  • single - Allows for 0 or 1 item to be selected. The selected item may be deselected.

  • radio - Allows for 0 or 1 item to be selected. The selected item may only be deselected by selecting another item.

  • multiple - Allows 0 to n items to be selected. Each item may be selected or deselected.

Default: 'single'
selected
NumberArray

The index(es) of the currently activated item.

selectedProp
String

The name of the DOM property that represents the selected state.

Default: 'data-selected'

GroupBaseComponent

ui/Group.GroupBase is a stateless component that supports selection of its child items via configurable properties and events.

import {GroupBase} from '@enact/ui/Group';
ArrayBooleanFunctionModuleNumberObjectString