UNPKG

@ark-ui/vue

Version:

A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.

20 lines (19 loc) 870 B
import { PropTypes } from '@zag-js/vue'; import { ComputedRef, MaybeRef } from 'vue'; import { EmitFn, Optional } from '../../types'; import { CollectionItem, ListCollection } from '../collection'; import { RootEmits } from './listbox'; import * as listbox from '@zag-js/listbox'; export interface UseListboxProps<T extends CollectionItem> extends Optional<Omit<listbox.Props<T>, 'dir' | 'getRootNode' | 'collection'>, 'id'> { /** * The model value of the listbox */ modelValue?: listbox.Props<T>['value']; /** * The collection of items */ collection: ListCollection<T>; } export interface UseListboxReturn<T extends CollectionItem> extends ComputedRef<listbox.Api<PropTypes, T>> { } export declare const useListbox: <T extends CollectionItem>(props: MaybeRef<UseListboxProps<T>>, emit?: EmitFn<RootEmits<T>>) => UseListboxReturn<T>;