@rezi-ui/ink-compat
v0.1.0-alpha.45
Published
Drop-in Ink compatibility layer powered by Rezi's rendering engine.
Readme
@rezi-ui/ink-compat
@rezi-ui/ink-compat is an Ink API compatibility layer powered by Rezi.
It preserves the Ink component and hook model while rendering through Rezi's engine.
Install
npm install @rezi-ui/ink-compatUse
Swap imports:
// Before
import { render, Box, Text } from "ink";
// After
import { render, Box, Text } from "@rezi-ui/ink-compat";For ecosystems that pin ink directly, use package manager overrides/resolutions to redirect ink to @rezi-ui/ink-compat and companion shims (ink-gradient, ink-spinner).
Supported surface
Components:
BoxTextNewlineSpacerStaticTransform
Hooks:
useAppuseInputuseFocususeFocusManageruseStdinuseStdoutuseStderruseIsScreenReaderEnableduseCursor
Runtime APIs:
renderrenderToStringmeasureElementResizeObservergetBoundingBoxgetInnerHeightgetScrollHeight
Keyboard utilities:
kittyFlagskittyModifiers
Testing utilities:
@rezi-ui/ink-compat/testing
Render options
render(element, options) supports:
stdout,stdin,stderrexitOnCtrlCpatchConsoledebugmaxFpsconcurrentkittyKeyboardisScreenReaderEnabledonRenderalternateBufferincrementalRendering
Diagnostics
Trace output is environment-gated:
INK_COMPAT_TRACE=1INK_COMPAT_TRACE_FILE=/path/logINK_COMPAT_TRACE_DETAIL=1INK_COMPAT_TRACE_DETAIL_FULL=1INK_GRADIENT_TRACE=1
Reference docs:
docs/architecture/ink-compat.mddocs/dev/ink-compat-debugging.md
Known boundaries
- Minor visual differences can occur across terminal emulators and OS TTY behavior.
- App-version and install-mode messaging differences are expected and not renderer bugs.
- Gradient interpolation can differ slightly from upstream while preserving overall behavior.
