useStack API
API reference for the useStack composable.
Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| useStack | Plugins |
| Scrim | Providers |
| createRegistry | Registration |
| createQueue | Registration |
Functions
createStack
(_options?: StackOptions) => StackContext<StackTicketInput, StackTicket<StackTicketInput>>Creates a new stack instance for managing overlay z-indexes.
createStackContext
(_options?: StackContextOptions) => ContextTrinity<StackContext<StackTicketInput, StackTicket<StackTicketInput>>>Creates a stack context trinity for provide/inject usage.
createStackPlugin
(_options?: StackPluginOptions) => import("/home/runner/work/0/0/packages/0/src/composables/index").PluginCreates a Vue plugin to provide stack context at app level.
useStack
(namespace?: string) => StackContext<StackTicketInput, StackTicket<StackTicketInput>>Returns the current stack context.
Options
disabled
MaybeRefOrGetter<boolean> | undefinedDisabled state for the entire model instance
Default: false
multiple
MaybeRefOrGetter<boolean> | undefinedAllow multiple tickets to be selected simultaneously
Default: false
mandatory
MaybeRefOrGetter<boolean | "force"> | undefinedControls mandatory selection behavior: - `false` (default): No mandatory selection enforcement - `true`: Prevents deselecting the last selected item - `'force'`: Automatically selects the first non-disabled item on registration
Properties
selectedValues
ComputedRef<Set<E["value"] extends Ref<infer U, infer U> ? U : E["value"]>>Computed Set of selected ticket values
Methods
seek
(direction?: "first" | "last", from?: number, predicate?: (ticket) => boolean) => E | undefinedSeek for a ticket based on direction and optional predicate
on
<K extends Extensible<RegistryEventName>>(event: K, cb: RegistryEventCallback<E, K>) => voidListen for registry events
off
<K extends Extensible<RegistryEventName>>(event: K, cb: RegistryEventCallback<E, K>) => voidStop listening for registry events
emit
<K extends Extensible<RegistryEventName>>(event: K, data: EventPayload<E, K>) => voidEmit an event with data
offboard
(ids: ID[]) => Partial<Z>[]Offboard multiple tickets at once, returning the input shapes that were removed.
batch
<R>(fn: () => R) => RExecute operations in a batch, deferring cache invalidation and event emission until complete