Skip to content

computeVariableRange

widgetsinput

Compute visible range for variable-height items

Installation

$ bunx termuijs add compute-variable-range

Copies the source into src/components/compute-variable-range/ and installs .

Usage

ts
import { computeVariableRange } from '@termuijs/widgets'
ts
const [value, setValue] = useState('')

<computeVariableRange
  value={value}
  onChange={setValue}
  placeholder="Enter text..."
/>

API Reference

computeVariableRange

PropTypeDefaultDescription
valuestringrequiredControlled value
onChange(v: string) => voidrequiredChange callback
placeholderstringPlaceholder text
isDisabledbooleanfalseDisable interaction
autoFocusbooleanfalseFocus on mount
#input#compute-variable-range