OptionalfilterThis is called for each item, if you provide it. Items for which this function returns false are hidden.
OptionalgetLists in React require a key prop. This function is called to get that key.
If this is omitted, the index is used as the key. NOTE: in React 18 it is
documented that "Non-unique keys may cause children to be duplicated and/or
omitted" and duplicate list items have been observed in this context when there
are duplicate keys. If you cannot guarantee unique keys, it is better not to
provide getKey at all (but this can cause its own problems, e.g. items losing
focus when the list order changes).
OptionalgetIf the items are stored in wrappers that can change between renders,
provide this function to get a subobject or id of the item that does
not change between renders. These "sel keys" are used in selection
(and in expandedParents in the related TreeList component).
Optionalitemprops that should apply to each item (usually Styles: className and style).
If RenderItem is provided, these props are forwarded to it. In a <DataTable>,
any styles in this object are applied to the row as a whole, not to each cell.
OptionallastThe most recently clicked item
List of items to display.
OptionalonThis is called immediately when an item is clicked, and if it returns 'abort' the click on the item will be ignored rather than changing the selection.
OptionalplaceholderContent to display when the list is empty. If this is a string, it's "grayed out"
using opacity: 0.5.
OptionalreadIf true, the whole list is read-only. If undefined, useIsReadOnlyContext
is used to decide whether the whole list is read-only.
OptionalrenderCalled to render a T value. If this is not provided, defaultRenderItem is
called to render each item.
OptionalRenderComponent type used to render the entire row (including an outer div or tr).
This is expected to forward a ref so that arrow keys can scroll the item into
view.
OptionalselectionThis is the set of selected items. If not provided, items can still be
selected but the selection state is internal to the list.
If the caller wishes to re-render on changes to the set of selected
items, it can use a MobX observable(set) rather than a plain Set<K>.
ListCore uses runInAction just in case it's an ObservableSet.
If type K isn't the same as T, you must provide a getSelKey prop.
OptionalselWhether to support selecting multiple things (default: no). 'noCtrl' mode is a multiselect mode in which each click is treated as if the Ctrl key (⌘ on Mac) is pressed; if it is actually pressed then a single item is selected and the rest of the selection is cleared.
'noSelect' mode prevents the selection from being changed by the user, so if the app itself does not select anything, nothing can be selected.
OptionalvirtualCalled when virtualization is enabled to render a placeholder element for a
virtualized gap. Set the gap element's ref prop to the ref parameter; the list uses
the ref to observe the gap so it can become real when it nears the viewport.
OptionalvirtualizeThese settings enable virtualization, which speeds up list rendering by not rendering off-screen items.
Main properties of a
<ListBox>or<ListCore>. The only required prop islist.T: Type of each item in the list K: Type of the "sel key" for each item (see
selectionandgetSelKey) ItemProps: type of additional props passed to each item, e.g. for styling