> For the complete documentation index, see [llms.txt](https://yinglinhan.gitbook.io/framer-x-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yinglinhan.gitbook.io/framer-x-api/library-ku/scroll/sizing.md).

# Sizing

Scroll组件要求你把所有内容都放到其内部的的Frame元素中，然后计算你滚动产生的偏移量。为了能使它正常工作，它需要能计算内容的总的尺寸。

组件本身会利用ResizeObserver尝试去自动测量组件内的子元素的尺寸，如果它不可用，会有其他的替代方案。但是如果你使用contentwidth和contentHeight，它就会选择不用不去自动测量，如果你想提高滚动动画的性能，那么你可以选择这样做，避免了自动测量的造成的性能损耗。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yinglinhan.gitbook.io/framer-x-api/library-ku/scroll/sizing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
