Skip to content

useTypeahead

jsxhook

Accumulates printable character keypresses to navigate lists by typing

Installation

$ bunx termuijs add use-typeahead

Copies the source into src/components/use-typeahead/ and installs @termuijs/jsx, @termuijs/motion.

Usage

ts
import { useTypeahead } from '@termuijs/jsx'
ts
const { value, set, reset } = useTypeahead({
  initial: undefined,
})

API Reference

useTypeahead

PropTypeDefaultDescription
initialT | undefinedInitial value
persistbooleanfalsePersist to storage
keystringStorage key
#hook#use-typeahead