DeferredComponent logo

DeferredComponent

Organization
lynx-family
DeferredComponent

Use DeferredComponent to delay mounting ReactLynx content by frames, reserve layout space, show a placeholder, and observe layout after the content appears.

Overview

Publisherlynx-family
Repositorylynx-ui
Skill nameDeferredComponent
Stars
119
Forks
13
Bundled files
12
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 12 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by lynx-family on GitHub. Read the source before you install it.

Installation

Install the DeferredComponent AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/lynx-family/lynx-ui.git /tmp/lynx-ui
mkdir -p .claude/skills
cp -r /tmp/lynx-ui/packages/lynx-ui-deferred-component .claude/skills/DeferredComponent
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable DeferredComponent in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads DeferredComponent on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so DeferredComponent is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

lynx-ui-deferred-component SKILL

Core Capabilities

DeferredComponent postpones mounting a child until its wrapper has completed its first layout. It supports additional frame delays and an optional placeholder. Use it when non-critical content should mount after the surrounding page starts laying out.

LazyComponent is the component for mounting based on viewport visibility. DeferredComponent does not observe visibility or virtualize a collection.

AI Coding Guide

Minimal Usable Example

tsx
import { DeferredComponent } from '@lynx-js/lynx-ui'

function DeferredPanel() {
  return (
    <DeferredComponent
      estimatedStyle={{ width: '100%', minHeight: '120px' }}
      placeholder={<text>Preparing content…</text>}
    >
      <view>
        <text>Content mounted after the first layout.</text>
      </view>
    </DeferredComponent>
  )
}

Recommended Prompt Formula

Scenario: Defer the non-critical [content] on a ReactLynx screen. Requirements: Mount it after [frame count] frames and reserve [estimated dimensions]. Appearance: Use [placeholder content] during the delay and style the child with [theme and classes]. Behavior: Report [layout handling] after the content appears and replay the delay when [remount condition] occurs.

Use Cases and Best Practices

Choose the delay

  • The default delayFrames={1} shows children after the first wrapper layout.
  • A finite value greater than 1 waits for delayFrames - 1 animation frames after that initial layout.
  • A value below 1 or a non-finite value (NaN, Infinity, or -Infinity) renders children directly. In this mode, there is no wrapper, placeholder, estimated style, or wrapper layout callback.
  • Use whole frame counts. The delay follows frame scheduling and is not a fixed duration in milliseconds.
tsx
<DeferredComponent
  delayFrames={3}
  estimatedStyle={{ width: '100%', minHeight: '160px' }}
  placeholder={<text>Preparing details…</text>}
>
  <Details />
</DeferredComponent>

Keep expensive rendering inside the child component. Calculations performed in the parent before creating the child still run immediately.

Reserve space and observe layout

estimatedStyle remains on the wrapper after the child appears. Use a fixed height for content with a known final size, or minHeight when the content should grow. Apply visual styles to the child and placeholder with their own CSS classes.

tsx
<DeferredComponent
  estimatedStyle={{ width: '100%', minHeight: '120px' }}
  onLayoutChange={({ width, height }) => {
    console.log(
      `[deferred-panel][onLayoutChange] size, width: ${width}, height: ${height}`,
    )
  }}
>
  <ResizableContent />
</DeferredComponent>

onLayoutChange receives { width, height } from wrapper layout events after the child appears. The initial event that starts the delay is not forwarded. This callback is not a loading-complete notification; an event depends on layout changing.

Replay the delay

The child stays mounted after it appears. Unmount and mount DeferredComponent, or give it a new React key, to restart the placeholder and delay. The examples use Button to demonstrate both patterns.

FAQ

Why is my placeholder barely visible?

The default delay is only the initial layout. Use a larger frame count when demonstrating the placeholder; choose production delays based on the screen's needs.

Why does changing delayFrames not replay an already visible child?

The component preserves its visible state until it is remounted. Change its key or unmount it when a new delay is needed.

Can I call a method through DeferredComponentRef?

DeferredComponentRef is an empty reserved interface. It exposes no imperative methods. Use mounting and props to control the component.

Sub-components and Public Types

DeferredComponent has no sub-components. Its public types are DeferredComponentProps and DeferredComponentRef.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the DeferredComponent AI skill do?

Use DeferredComponent to delay mounting ReactLynx content by frames, reserve layout space, show a placeholder, and observe layout after the content appears.

Why use DeferredComponent on TypingMind?

Because you install it once and use it with any model. DeferredComponent is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install DeferredComponent in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/lynx-family/lynx-ui/tree/main/packages/lynx-ui-deferred-component. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use DeferredComponent?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with DeferredComponent?

As many as you like. As long as a model supports skills, you can use DeferredComponent with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the DeferredComponent AI skill free?

Yes. It is published on GitHub by lynx-family under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇