一个无样式、轻量级的库,将 iframe 管理在应用渲染树之外,在挂载/卸载过程中保持其状态。

Stars

50

7 天增长

暂无数据

Fork 数

2

开放 Issue

0

开源协议

MIT

最近更新

2026-07-06

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

该库从 Vite DevTools、Nuxt DevTools 等实际项目中提取而来,用极简且框架无关的方式解决了组件框架中 iframe 状态丢失的常见痛点。

适合谁使用

  • 使用 Vue、React 或 Solid 且需要稳定嵌入 iframe 的开发者
  • 构建多标签页仪表盘或面板,需要持久化内嵌内容的用户
  • 需要状态化 iframe 生命周期的工具构建者(如 IDE、开发者工具)

典型使用场景

  • 在仪表盘中切换标签页时不重新加载 iframe 内容
  • 将嵌入式 iframe 移动到不同布局位置,保留滚动、输入和 JS 状态
  • 隐藏和显示预览面板时,不让其渲染被节流

项目优势

  • 零依赖,框架无关;可与纯 DOM 或任何组件库一起使用
  • 通过永不重新渲染的专用覆盖容器实现状态保持
  • 热隐藏(opacity: 0.001)使嵌入页面保持完全活跃且不节流
  • LRU 自动释放机制限制内存使用,适合管理多个面板

使用前须知

  • 默认容器为 position:fixed,若祖先元素创建了层叠上下文则需自定义容器
  • 面板位置跟随目标框但非目标生命周期;目标从 DOM 移除时需手动调用 unmount
  • 多个面板挂载到同一目标时会按创建顺序堆叠,无内置冲突解决方案

README 快速开始

Usage

项目描述

Pane for manage and persistent iframes

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

TanStack
精选
TanStack GitHub avatar

router

TanStack Router is a type-safe, data-driven React router with built-in caching, prefetching, and nested layouts, while TanStack Start extends it into a full-stack SSR framework.

Web 开发前端框架
14,861
vercel-labs
精选
vercel-labs GitHub avatar

scriptc

scriptc compiles ordinary TypeScript into small, fast native executables without needing Node.js, V8, or any JavaScript runtime in the binary.

开发者工具代码质量与构建
1,985
Jakubantalik
精选
Jakubantalik GitHub avatar

thinking-orbs

A React component library that renders six hand-tuned animated thought orb loading indicators on a plain 2D canvas, with two purpose-tuned sizes and automatic theme detection for AI and agent UIs.

AI 与机器学习AI 智能体
1,191