For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/ui/components/lazy-component.md.
lynx-ui logo
lynx-ui
  • English
  • LazyComponent

    A LazyComponent for ReactLynx. It defers the loading of non-critical UI elements.
    Info

    You can check the source code to understand how it works, and you're welcome to submit MRs to enhance its capabilities.

    Basic Usage

    <LazyComponent> renders its content after it's exposed, optimizing initial screen rendering performance

    Examples

    Adjust Visibility Margin

    Adjust the visibility margin to render <LazyComponent> content earlier, optimizing the visual experience of scrolling and animations.

    Structure

    <LazyComponent>
      {/* Your content */}
    </LazyComponent>

    Component API

    LazyComponent

    bottomiOSAndroid
    Typepx | rpx·Default10px
    To change the viewport size of the target node itself during exposure. >0 means extending the lower boundary of the node, <0 means shrinking the lower boundary of the node.
    childreniOSAndroid
    TypeReactNode
    Children
    estimatedStyleiOSAndroid
    TypeCSSProperties
    Estimated height and width need to be set
    leftiOSAndroid
    Typepx | rpx·Default10px
    To change the viewport size of the target node itself during exposure. >0 means extending the left boundary of the node, <0 means shrinking the left boundary of the node.
    pidiOSAndroid
    Typestring
    Be used to mark the exposure timing of lazy loading. Please ensure that it is unique throughout the page.
    rightiOSAndroid
    Typepx | rpx·Default10px
    To change the viewport size of the target node itself during exposure. >0 means extending the right boundary of the node, <0 means shrinking the right boundary of the node.
    sceneiOSAndroid
    Typestring
    Be used to mark the exposure timing of lazy loading. Please ensure that it is unique throughout the page.
    topiOSAndroid
    Typepx | rpx·Default10px
    To change the viewport size of the target node itself during exposure. >0 means extending the upper boundary of the node, <0 means shrinking the upper boundary of the node.
    unloadableiOSAndroid
    Typeboolean·Defaultfalse
    Unload child when dis-exposure to save mem-usage
    unmountOnExitiOSAndroid
    Typeboolean·Defaultfalse
    Unmount child when dis-exposure to save mem-usage
    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.