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