Image
Image-state foundation that aligns loading, loaded, error, fit, sizing, and placeholders.
Runtime ownership
useImageRoot comes from @varo-ui/headless; H5 renders img while Weapp uses native image.
Demo
Loading
Install
bash
pnpm add @varo-ui/headless @varo-ui/h5
# or
pnpm add @varo-ui/headless @varo-ui/weappWhy this is foundational
- Avatars, product media, and generated images need stable load and failure states.
- Wrappers or slots own placeholder and error visuals.
Parts
| Part | Role |
|---|---|
ImageRoot | Image state, dimensions, fit, and loading/error slots |
State and events
- State:
src,fit,width,height,round, andlazyLoad - Events:
load,error, andclick.
Platform notes
State aligns across targets; image elements, lazy loading, and fit stay runtime-owned.