createGroup API API reference for the createGroup composable.
(_options?: GroupOptions) => ECreates a new group instance with batch selection and tri-state support.
Extends `createSelection` to support selecting, unselecting, and toggling multiple items
at once by passing an array of IDs. Adds tri-state (mixed/indeterminate) support for
checkbox trees and similar use cases.
Show code example
(_options?: GroupContextOptions) => ContextTrinity<E>Creates a new group context.
Show code example
(namespace?: string) => EReturns the current group instance.
Show code example
booleanEnable event emission for registry operations
Default: false
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
ReadonlyMap<ID, Z>The collection of tickets in the registry
numberThe number of tickets in the registry
Show code example
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
Reactive<Set<ID>>Set of mixed/indeterminate ticket IDs
ComputedRef<Set<Z>>Set of mixed/indeterminate ticket instances
ComputedRef<boolean>Whether no items are currently selected
ComputedRef<boolean>Whether all selectable (non-disabled) items are selected
ComputedRef<boolean>Whether some but not all selectable items are selected
() => voidClear the entire registry
Show code example
(id: ID) => booleanCheck if a ticket exists by ID
Show code example
() => ID[]Get all registered IDs
Show code example
(value: unknown) => ID[] | undefinedBrowse for an ID(s) by value
Show code example
(index: number) => ID | undefinedlookup a ticket by index number
Show code example
(id: ID) => Z | undefinedGet a ticket by ID
Show code example
(id: ID, ticket?: Partial<Z>) => ZUpdate or insert a ticket by ID
Show code example
() => Z[]Get all values of registered tickets
Show code example
() => [ID, Z][]Get all entries of registered tickets
Show code example
(ticket?: Partial<Z>) => ZRegister a new ticket
Show code example
(id: ID) => voidUnregister an ticket by ID
Show code example
() => voidReset the index directory and update all tickets
Show code example
(direction?: "first" | "last", from?: number, predicate?: (ticket) => boolean) => Z | undefinedSeek for a ticket based on direction and optional predicate
Show code example
(event: string, cb: RegistryEventCallback) => voidListen for registry events
Show code example
(event: string, cb: RegistryEventCallback) => voidStop listening for registry events
Show code example
(event: string, data: unknown) => voidEmit an event with data
Show code example
() => voidClears the registry and removes all listeners
Show code example
(registrations: Partial<Z>[]) => Z[]Onboard multiple tickets at once
Show code example
(ids: ID[]) => voidOffboard multiple tickets at once
Show code example
<R>(fn: () => R) => RExecute operations in a batch, deferring cache invalidation and event emission until complete
Show code example
() => 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
(ids: ID | ID[]) => voidSet one or more Tickets to mixed/indeterminate state by ID
(ids: ID | ID[]) => voidClear mixed/indeterminate state from one or more Tickets by ID
(id: ID) => booleanCheck if a ticket is in mixed/indeterminate state by ID
() => voidSelect all selectable (non-disabled) items
() => voidUnselect all items (respects mandatory option)
() => voidToggle between all selected and none selected