useFocusManager
jsxhook
useFocusManager: manages focus state for a subtree
Terminal
$termuijs render use-focus-manager
Installation
$ bunx termuijs add use-focus-manager
Copies the source into src/components/use-focus-manager/ and installs @termuijs/jsx.
Usage
ts
import { useFocusManager } from '@termuijs/jsx'ts
const { value, set, reset } = useFocusManager({
initial: undefined,
})API Reference
useFocusManager
| Prop | Type | Default | Description |
|---|---|---|---|
initial | T | undefined | — | Initial value |
persist | boolean | false | Persist to storage |
key | string | — | Storage key |