useSelection API
API reference for the useSelection composable.
MaybeRef<boolean>When true, the entire selection instance is disabled.
booleanWhen true, newly registered items are automatically selected if not disabled.
Useful for pre-selecting items in multi-select scenarios.
boolean | "force"Controls mandatory selection behavior:
- `false` (default): No mandatory selection enforcement
- `true`: Prevents deselecting the last selected item (user must always have one selected)
- `'force'`: Automatically selects the first non-disabled item on registration
booleanWhen true, treats the selection as an array
Reactive<Set<ID>>Set of selected ticket IDs
ComputedRef<Set<Z>>Set of selected ticket instances
ComputedRef<Set<unknown>>Set of selected ticket values
MaybeRef<boolean>Disable state for the entire selection instance
() => voidClear all selected IDs and reindexes
(id: ID) => voidSelect a ticket by ID (Toggle ON)
(id: ID) => voidUnselect a ticket by ID (Toggle OFF)
(id: ID) => voidToggles a ticket ON and OFF by ID
(id: ID) => booleanCheck if a ticket is selected by ID
() => voidMandates selected ID based on "mandatory" Option