Loading...
Loading...
Compare original and translation side by side
<Text><Text><Text><Text><Box><Text><Box>display: flex<Box><div style="display: flex">useApp().exit()process.exit()inkreactnpm install ink react<Static><Text><Text><Text><Text><Text><Box><Box>display: flex<Box><div style="display: flex">useApp().exit()process.exit()inkreactnpm install ink react<Static>./references/core/| File | Purpose | When to Read |
|---|---|---|
| Overview, when to use, quick start | Always read first |
| render(), renderToString(), Instance, measureElement | Writing code |
| Render options, environment vars | Configuring an app |
| Common patterns, best practices | Implementation guidance |
| Pitfalls, limitations, debugging | Troubleshooting |
./references/<area>/REFERENCE.md./references/core/| 文件 | 用途 | 阅读时机 |
|---|---|---|
| 概览、适用场景、快速开始 | 务必首先阅读 |
| render()、renderToString()、Instance、measureElement | 编写代码时 |
| 渲染选项、环境变量 | 配置应用时 |
| 常见模式、最佳实践 | 实现指导 |
| 陷阱、限制、调试 | 故障排查时 |
./references/<area>/REFERENCE.mdcore/REFERENCE.mdcomponents/REFERENCE.mdhooks/input.mdlayout/REFERENCE.mdhooks/app-lifecycle.mdhooks/focus.mdtesting/REFERENCE.mdaccessibility/REFERENCE.mdcore/gotchas.mdrules/RULES.mdcore/REFERENCE.mdcomponents/REFERENCE.mdhooks/input.mdlayout/REFERENCE.mdhooks/app-lifecycle.mdhooks/focus.mdtesting/REFERENCE.mdaccessibility/REFERENCE.mdcore/gotchas.mdrules/RULES.md./references/core/REFERENCE.md # Start here
./references/core/api.md # render(), renderToString()
./references/components/text.md # <Text> component
./references/components/box.md # <Box> component (layout, borders)
./references/hooks/input.md # useInput hook
./references/layout/patterns.md # Common layout recipes
./references/testing/REFERENCE.md # ink-testing-library
./rules/RULES.md # Best practices entry point
./rules/performance.md # FPS, Static, memoization
./rules/components.md # Per-component rules
./rules/hooks.md # Per-hook rules
./rules/core.md # render(), errors, environment./references/core/REFERENCE.md # 从这里开始
./references/core/api.md # render()、renderToString()
./references/components/text.md # <Text>组件
./references/components/box.md # <Box>组件(布局、边框)
./references/hooks/input.md # useInput钩子
./references/layout/patterns.md # 常见布局方案
./references/testing/REFERENCE.md # ink-testing-library
./rules/RULES.md # 最佳实践入口
./rules/performance.md # FPS、Static、 memoization
./rules/components.md # 组件专属规则
./rules/hooks.md # 钩子专属规则
./rules/core.md # render()、错误、环境Display content?
├─ Plain or styled text -> components/text.md
├─ Container with layout -> components/box.md
├─ Container with borders -> components/box.md (borderStyle)
├─ Container with background color -> components/box.md (backgroundColor)
├─ Line breaks within text -> components/utilities.md (Newline)
├─ Flexible spacer -> components/utilities.md (Spacer)
├─ Permanent log output (completed items) -> components/utilities.md (Static)
└─ Transform text output (uppercase, gradient) -> components/utilities.md (Transform)需要展示内容?
├─ 普通或带样式文本 -> components/text.md
├─ 带布局的容器 -> components/box.md
├─ 带边框的容器 -> components/box.md(borderStyle)
├─ 带背景色的容器 -> components/box.md(backgroundColor)
├─ 文本内换行 -> components/utilities.md(Newline)
├─ 弹性间隔符 -> components/utilities.md(Spacer)
├─ 永久日志输出(已完成内容) -> components/utilities.md(Static)
└─ 文本转换(大写、渐变) -> components/utilities.md(Transform)User input?
├─ Keyboard shortcuts/arrow keys -> hooks/input.md (useInput)
├─ Raw stdin access -> hooks/stdio.md (useStdin)
├─ Tab/Shift+Tab focus cycling -> hooks/focus.md (useFocus)
├─ Programmatic focus control -> hooks/focus.md (useFocusManager)
└─ Cursor positioning (IME) -> hooks/focus.md (useCursor)需要处理用户输入?
├─ 键盘快捷键/方向键 -> hooks/input.md(useInput)
├─ 原始stdin访问 -> hooks/stdio.md(useStdin)
├─ Tab/Shift+Tab焦点循环 -> hooks/focus.md(useFocus)
├─ 程序化焦点控制 -> hooks/focus.md(useFocusManager)
└─ 光标定位(IME) -> hooks/focus.md(useCursor)Layout?
├─ Horizontal row of elements -> layout/REFERENCE.md (flexDirection: row)
├─ Vertical stack of elements -> layout/REFERENCE.md (flexDirection: column)
├─ Centering content -> layout/patterns.md
├─ Spacing between elements -> layout/REFERENCE.md (gap, margin, padding)
├─ Fixed width/height -> components/box.md (width, height)
├─ Percentage sizing -> components/box.md (width: "50%")
├─ Min/max constraints -> components/box.md (minWidth, maxWidth, maxHeight)
├─ Push elements apart -> components/utilities.md (Spacer)
├─ Flex grow/shrink -> layout/REFERENCE.md (flexGrow, flexShrink)
├─ Wrapping content -> layout/REFERENCE.md (flexWrap)
├─ Overflow control -> components/box.md (overflow)
└─ Complex nested layouts -> layout/patterns.md需要布局?
├─ 元素水平排列 -> layout/REFERENCE.md(flexDirection: row)
├─ 元素垂直堆叠 -> layout/REFERENCE.md(flexDirection: column)
├─ 内容居中 -> layout/patterns.md
├─ 元素间间距 -> layout/REFERENCE.md(gap、margin、padding)
├─ 固定宽高 -> components/box.md(width、height)
├─ 百分比尺寸 -> components/box.md(width: "50%")
├─ 最小/最大约束 -> components/box.md(minWidth、maxWidth、maxHeight)
├─ 元素分散排列 -> components/utilities.md(Spacer)
├─ 弹性伸缩 -> layout/REFERENCE.md(flexGrow、flexShrink)
├─ 内容换行 -> layout/REFERENCE.md(flexWrap)
├─ 溢出控制 -> components/box.md(overflow)
└─ 复杂嵌套布局 -> layout/patterns.mdApp lifecycle?
├─ Mount and render -> core/api.md (render)
├─ Render to string (no terminal) -> core/api.md (renderToString)
├─ Exit the app programmatically -> hooks/app-lifecycle.md (useApp, exit)
├─ Wait for app to finish -> core/api.md (waitUntilExit)
├─ Re-render with new props -> core/api.md (rerender)
├─ Unmount the app -> core/api.md (unmount)
└─ Write to stdout/stderr outside Ink -> hooks/stdio.md需要管理应用生命周期?
├─ 挂载与渲染 -> core/api.md(render)
├─ 渲染为字符串(无终端) -> core/api.md(renderToString)
├─ 程序化退出应用 -> hooks/app-lifecycle.md(useApp、exit)
├─ 等待应用完成 -> core/api.md(waitUntilExit)
├─ 传入新属性重新渲染 -> core/api.md(rerender)
├─ 卸载应用 -> core/api.md(unmount)
└─ 在Ink外部写入stdout/stderr -> hooks/stdio.mdTesting?
├─ Render and check output -> testing/REFERENCE.md
├─ Simulate user input -> testing/REFERENCE.md (stdin.write)
├─ Snapshot testing -> testing/REFERENCE.md
└─ Check last rendered frame -> testing/REFERENCE.md (lastFrame)需要测试?
├─ 渲染并检查输出 -> testing/REFERENCE.md
├─ 模拟用户输入 -> testing/REFERENCE.md(stdin.write)
├─ 快照测试 -> testing/REFERENCE.md
└─ 检查最后渲染帧 -> testing/REFERENCE.md(lastFrame)Accessibility?
├─ Screen reader support -> accessibility/REFERENCE.md
├─ ARIA roles (checkbox, button, etc.) -> accessibility/REFERENCE.md
├─ ARIA state (checked, disabled, etc.) -> accessibility/REFERENCE.md
├─ Custom screen reader labels -> accessibility/REFERENCE.md (aria-label)
└─ Hide from screen readers -> accessibility/REFERENCE.md (aria-hidden)需要无障碍访问?
├─ 屏幕阅读器支持 -> accessibility/REFERENCE.md
├─ ARIA角色(复选框、按钮等) -> accessibility/REFERENCE.md
├─ ARIA状态(已选中、禁用等) -> accessibility/REFERENCE.md
├─ 自定义屏幕阅读器标签 -> accessibility/REFERENCE.md(aria-label)
└─ 对屏幕阅读器隐藏内容 -> accessibility/REFERENCE.md(aria-hidden)Troubleshooting?
├─ Text rendering issues -> core/gotchas.md
├─ Layout problems -> core/gotchas.md + layout/REFERENCE.md
├─ Input not working -> core/gotchas.md + hooks/input.md
├─ Process not exiting -> core/gotchas.md
├─ CI rendering issues -> core/configuration.md (CI mode)
├─ Console output mixing -> core/configuration.md (patchConsole)
└─ Performance/flickering -> core/configuration.md + rules/performance.md需要故障排查?
├─ 文本渲染问题 -> core/gotchas.md
├─ 布局问题 -> core/gotchas.md + layout/REFERENCE.md
├─ 输入无响应 -> core/gotchas.md + hooks/input.md
├─ 进程无法退出 -> core/gotchas.md
├─ CI环境渲染问题 -> core/configuration.md(CI模式)
├─ 控制台输出混乱 -> core/configuration.md(patchConsole)
└─ 性能/闪烁问题 -> core/configuration.md + rules/performance.mdBest practices?
├─ General rules (critical) -> rules/RULES.md
├─ Performance (FPS, Static, memoization) -> rules/performance.md
├─ Per-component patterns & anti-patterns -> rules/components.md
├─ Per-hook patterns & gotchas -> rules/hooks.md
└─ render() / errors / environment behavior -> rules/core.md需要最佳实践?
├─ 通用规则(关键) -> rules/RULES.md
├─ 性能优化(FPS、Static、memoization) -> rules/performance.md
├─ 组件模式与反模式 -> rules/components.md
├─ 钩子模式与陷阱 -> rules/hooks.md
└─ render()/错误/环境行为 -> rules/core.md<Text>core/gotchas.md<Box><Text>core/gotchas.mdcore/gotchas.mdcore/configuration.mdlayout/REFERENCE.mdhooks/input.mdrules/hooks.mdhooks/focus.mdrules/hooks.mdcore/configuration.mdrules/core.mdcore/configuration.mdrules/performance.mdrules/components.mdrules/hooks.mdrules/core.md<Text>core/gotchas.md<Box><Text>core/gotchas.mdcore/gotchas.mdcore/configuration.mdlayout/REFERENCE.mdhooks/input.mdrules/hooks.mdhooks/focus.mdrules/hooks.mdcore/configuration.mdrules/core.mdcore/configuration.mdrules/performance.mdrules/components.mdrules/hooks.mdrules/core.md| Area | Entry File | Description |
|---|---|---|
| Core | | Overview, quick start, project setup |
| API | | render, renderToString, Instance |
| Config | | Render options, environment variables |
| Patterns | | Common patterns and recipes |
| Gotchas | | Pitfalls and debugging |
| 领域 | 入口文件 | 描述 |
|---|---|---|
| 核心 | | 概览、快速开始、项目搭建 |
| API | | render、renderToString、Instance |
| 配置 | | 渲染选项、环境变量 |
| 模式 | | 常见模式与方案 |
| 陷阱 | | 常见陷阱与调试 |
| Component | Entry File | Description |
|---|---|---|
| Overview | | All components at a glance |
| Text | | Text display and styling |
| Box | | Layout, borders, backgrounds |
| Utilities | | Newline, Spacer, Static, Transform |
| 组件 | 入口文件 | 描述 |
|---|---|---|
| 概览 | | 所有组件一览 |
| Text | | 文本展示与样式 |
| Box | | 布局、边框、背景 |
| 工具组件 | | Newline、Spacer、Static、Transform |
| Hook | Entry File | Description |
|---|---|---|
| Overview | | All hooks at a glance |
| Input | | useInput for keyboard handling |
| App Lifecycle | | useApp for exit control |
| Stdio | | useStdin, useStdout, useStderr |
| Focus | | useFocus, useFocusManager, useCursor |
| 钩子 | 入口文件 | 描述 |
|---|---|---|
| 概览 | | 所有钩子一览 |
| 输入 | | useInput键盘处理 |
| 应用生命周期 | | useApp退出控制 |
| 标准IO | | useStdin、useStdout、useStderr |
| 焦点 | | useFocus、useFocusManager、useCursor |
| Concept | Entry File | Description |
|---|---|---|
| Layout | | Yoga/Flexbox layout system |
| Layout Patterns | | Common layout recipes |
| Testing | | ink-testing-library |
| Accessibility | | Screen reader & ARIA support |
| 概念 | 入口文件 | 描述 |
|---|---|---|
| 布局 | | Yoga/Flexbox布局系统 |
| 布局模式 | | 常见布局方案 |
| 测试 | | ink-testing-library |
| 无障碍访问 | | 屏幕阅读器与ARIA支持 |
| Rule File | Entry File | Description |
|---|---|---|
| Overview | | Entry point + 10 critical rules |
| Performance | | FPS tuning, Static, memoization, incremental rendering |
| Components | | Box, Text, Static, Transform, Newline, Spacer rules |
| Hooks | | useInput, useApp, useFocus, useCursor, useStdin rules |
| Core | | render(), renderToString(), errors, CI, Kitty protocol |
| 规则文件 | 入口文件 | 描述 |
|---|---|---|
| 概览 | | 入口 + 10条关键规则 |
| 性能 | | FPS调优、Static、memoization、增量渲染 |
| 组件 | | Box、Text、Static、Transform、Newline、Spacer规则 |
| 钩子 | | useInput、useApp、useFocus、useCursor、useStdin规则 |
| 核心 | | render()、renderToString()、错误、CI、Kitty协议 |