Skip to main content
Vuetify0 Logo
Theme
Mode
Palettes
Accessibility
Vuetify One
Sign in to Vuetify One

Access premium tools across the Vuetify ecosystem — Bin, Play, Studio, and more.

Not a subscriber? See what's included

useTypeahead API

Prefix-matches typed characters against a list, accumulates them for one second, and cycles on a repeated letter.

Explore these related pages for additional context and usage patterns.

PageCategory
useTypeaheadSystem
useTimerSystem
useProxyRegistryReactivity
useProxyModelReactivity
SelectForms

Functions

useTypeahead

(items: () => readonly T[], options: TypeaheadOptions<T>) => TypeaheadReturn<T>

Match typed characters against a list. items is read on every key, in the order given. Matching is a case-insensitive startsWith against options.text. Text is not trimmed. Disabled items are not skipped — omit them from items to filter.

Options

text required

(item: T) => string

Text used for prefix matching. Read on every key.

duration

MaybeRefOrGetter<number> | undefined

Inactivity window before the buffer clears, in milliseconds. Accepts a plain number, ref, or getter — read fresh on each key.

Default: 1000

Methods

typeahead

(char: string) => TypeaheadMatch<T> | undefined

Append char to the buffer and return the next prefix match. Restarts the inactivity window on every call, hit or miss.

reset

() => void

Clear the buffer and stop the inactivity window.

Was this page helpful?

© 2016-1970 Vuetify, LLC
Services
Ctrl+/