UseListParameters

Properties

Link copied to clipboard
abstract var componentName: String?

The name of the component using useList. For debugging purposes.

Link copied to clipboard
abstract var controlledProps: Props?

The externally controlled values (highlighted and selected item(s)) of the list. If a custom state is used, this object can contain the added state fields as well.

Link copied to clipboard

If true, it will be possible to highlight disabled items.

Link copied to clipboard
abstract var disableListWrap: Boolean?

If true, the highlight will not wrap around the list if arrow keys are used.

Link copied to clipboard

The focus management strategy used by the list. Controls the attributes used to set focus on the list items.

Link copied to clipboard
abstract var getInitialState: () -> State?

A function that intializes the state of the list. It is required when using a custom state with mandatory fields. If not provided, the state will be initialized with the default values (nothing highlighted or selected).

Link copied to clipboard
abstract var getItemAsString: (option: ItemValue) -> String??

A function that converts an object to its string representation

Link copied to clipboard
abstract var getItemDomElement: (itemValue: ItemValue) -> HTMLElement??

A function that returns the DOM element associated with an item. This is required when using the DOM focus management.

Link copied to clipboard
abstract var getItemId: (itemValue: ItemValue) -> String??

A function that returns the id of an item. This is required when using the activeDescendant focus management.

Link copied to clipboard
abstract var isItemDisabled: (itemValue: ItemValue, index: Number) -> Boolean?

A function that determines if a particular item is disabled.

Link copied to clipboard
abstract var itemComparer: (itemValue1: ItemValue, itemValue2: ItemValue) -> Boolean?

A function that tests equality between two items' values.

Link copied to clipboard

Array of list items.

Link copied to clipboard
abstract var onChange: (event: SyntheticEvent<*, *>?, ReadonlyArray<ItemValue>, reason: String) -> Unit?

Callback fired when the selected value changes. This is a strongly typed convenience event that can be used instead of onStateChange.

Link copied to clipboard
abstract var onHighlightChange: (event: SyntheticEvent<*, *>?, option: ItemValue?, reason: String) -> Unit?

Callback fired when the highlighted option changes. This is a strongly typed convenience event that can be used instead of onStateChange.

Link copied to clipboard

Callback fired when the items change.

Link copied to clipboard
abstract var onStateChange: Any?

Callback fired when the any of the state items change. Note that in case of selectedValues and highlightedValue the strongly typed onChange and onHighlightChange callbacks are also fired.

Link copied to clipboard
abstract var orientation: Union?

Orientation of the items in the list. Determines the actions that are performed when arrow keys are pressed.

Link copied to clipboard
abstract var pageSize: Number?

The number of items skip when using the page up and page down keys.

Link copied to clipboard

Additional data to be passed to all the reducer actions. It will be available in the context property of the action when dispatched.

Link copied to clipboard
abstract var rootRef: Ref<Element>?

Ref to the list root DOM element.

Link copied to clipboard
abstract var selectionMode: Union?

Controls how many items can be selected at once: none (the selection functionality is disabled in this case), one, or indefinitely many.

Link copied to clipboard
abstract var stateReducer: Any?

Custom state reducer function. It calculates the new state (highlighted and selected items + optional custom state) based on the previous one and the performed action.