blessed-components - v1.20.0
    Preparing search index...

    Interface CreateSelectionModelOptions<TItem>

    Options accepted by createSelectionModel.

    interface CreateSelectionModelOptions<TItem extends CollectionItem> {
        allowEmpty?: boolean;
        defaultSelectedIds?: readonly string[];
        items: readonly TItem[];
        mode?: SelectionMode;
        onChange?: (selectedIds: readonly string[]) => void;
    }

    Type Parameters

    Index

    Properties

    allowEmpty?: boolean

    Whether the current selection may become empty.

    true

    defaultSelectedIds?: readonly string[]

    Initial selected identifiers for uncontrolled state.

    items: readonly TItem[]

    Ordered selectable items. Disabled items cannot be selected.

    Selection cardinality.

    'single'

    onChange?: (selectedIds: readonly string[]) => void

    Called synchronously after the selected identifiers change.