OptionaltrackBy: (item: T) => unknownReadonlyisWhether nothing is selected.
ReadonlymodeThe active selection mode.
ReadonlyselectedRead-only signal of the currently selected items, in insertion order.
ReadonlyselectedRead-only signal of the number of selected items.
ReadonlytrackOptional function that returns a unique identity key for an item.
When provided, selection comparisons use this key instead of ===.
Clear the entire selection.
Returns true when every item in the given array is selected. Returns false for empty arrays.
Returns true when at least one — but not all — items are selected. Useful for the "indeterminate" checkbox state.
Select all items from the provided array.
Only meaningful in 'multiple' mode.
Toggle an item's selection state.
In single mode, selecting a new item deselects the previous one. In multiple mode, the item is added/removed independently.
Reactive selection model that tracks selected items.
Exposes read-only signals for the current selection and provides imperative methods to toggle, set, and clear the selection.
The model uses object-identity (
===) to track items. Consumers can optionally supply atrackByfunction that maps each item to a stable identity key (e.g. a database ID) — this makes the selection survive data refreshes where the item objects are recreated with new references but represent the same record.