webf-async-rendering

Measure WebF element dimensions using onscreen events and the useFlutterAttached hook.

4|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/VIDLG/webfly --skill webf-async-rendering-vidlg
Or copy as Structured Prompt for Agentâ–¼
Please help me install this Agent Skill.
Skill: webf-async-rendering
Source: https://github.com/VIDLG/webfly/tree/main/.claude/skills/webf-async-rendering
Command: npx skills add https://github.com/VIDLG/webfly --skill webf-async-rendering-vidlg

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @openwebf/react-core-ui, and includes references (resource) components.

What problem does it solve?

This Skill addresses the core challenge of WebF development: its asynchronous rendering model, which differs significantly from browser behavior and can lead to incorrect element measurements and layout issues.

Core Features & Use Cases

  • Understand Async Rendering: Learn why WebF renders asynchronously and its performance benefits.
  • Correct Measurement: Master the use of onscreen and offscreen events for accurate element dimensions and styles.
  • React Integration: Utilize the useFlutterAttached hook for seamless measurement in React applications.
  • Use Case: When getBoundingClientRect() returns zeros or elements don't appear as expected after DOM manipulation, this Skill provides the solution.

Quick Start

Use the webf-async-rendering skill to understand how to correctly measure an element's dimensions after it has been added to the DOM.

Frequently Asked Questions about webf-async-rendering

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does getBoundingClientRect return zeros in WebF after DOM manipulation?â–¼

WebF uses an asynchronous rendering model, meaning layout updates happen differently than browser synchronous layout. You must use onscreen events or the useFlutterAttached hook to measure elements correctly after they are added to the DOM.

How do I correctly measure element dimensions in WebF?â–¼

To measure element dimensions correctly in WebF, use the onscreen and offscreen events. These events fire when the asynchronous rendering completes, ensuring the returned dimensions and styles are accurate.

How does WebF's asynchronous rendering model differ from browser synchronous layout?â–¼

WebF's asynchronous rendering model processes layout updates outside the main thread, contrasting with browser synchronous layout. This approach improves performance but requires specific event handling for accurate measurements.

How do I use the useFlutterAttached React hook for WebF layout measurement?â–¼

The useFlutterAttached React hook allows you to measure element dimensions seamlessly in WebF. It ensures your application waits for the asynchronous rendering to attach elements before attempting to read their dimensions or styles.

Can I use React with WebF to handle onscreen events for element measurement?â–¼

Yes, you can use React with WebF to handle onscreen events. The useFlutterAttached hook integrates directly with React to trigger measurements only after the WebF asynchronous rendering process finishes.

Why are my WebF elements not appearing or positioned incorrectly after DOM updates?â–¼

Incorrect element positioning in WebF occurs because of its asynchronous rendering model. Using onscreen events ensures you wait for the layout to fully render before applying style calculations or positioning logic.