useTypeahead
jsxhook
Accumulates printable character keypresses to navigate lists by typing
Terminal
$termuijs render use-typeahead
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
| Prop | Type | Default | Description |
|---|---|---|---|
initial | T | undefined | — | Initial value |
persist | boolean | false | Persist to storage |
key | string | — | Storage key |