Skip to content

useTerminalSize

jsxhook

useTerminalSize component

Installation

$ bunx termuijs add use-terminal-size

Copies the source into src/components/use-terminal-size/ and installs @termuijs/jsx.

Usage

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

API Reference

useTerminalSize

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