Input
Text-input foundation for controlled values, formatting, readonly, invalid state, length, and textarea autosize.
Runtime ownership
useFieldRoot comes from @varo-ui/headless; IME, DOM/WXML, and autosize stay target-owned.
Demo
Install
bash
pnpm add @varo-ui/headless @varo-ui/h5
# or
pnpm add @varo-ui/headless @varo-ui/weappWhy this is foundational
- Every form field needs one value and invalid contract.
- Business wrappers can reuse formatter timing without replacing the primitive.
Parts
| Part | Role |
|---|---|
InputRoot | Value, state, formatting, and native input events |
State and events
- State:
value,defaultValue,disabled,readonly, andinvalid - Events:
update:value,valueChange,focus, andblur.
Platform notes
H5 supports textarea autosize; Weapp preserves the public contract on native inputs.