Skip to content

Migration from Ink

BetterTUI is API-compatible with Ink. Migration is straightforward.

Terminal window
# Remove Ink
pnpm remove ink react-reconciler
# Add BetterTUI
pnpm add @bettertui/react
// Before (Ink)
import { Box, Text, useInput } from 'ink';
// After (BetterTUI)
import { Box, Text, useInput } from '@bettertui/react';
// Ink
import { render } from 'ink';
render(<App />);
// BetterTUI
import { render } from '@bettertui/react';
render(<App />);
// Ink
useInput((input, key) => {
if (key.return) { /* ... */ }
});
// BetterTUI (same API)
useInput((input, key) => {
if (key.return) { /* ... */ }
});
// Ink
import { useApp } from 'ink';
const { exit, isRawModeSupported } = useApp();
// BetterTUI
import { useApp } from '@bettertui/react';
const { exit, isRawModeSupported } = useApp();

BetterTUI adds features not available in Ink:

  • Flexbox layout via Taffy (CSS Flexbox, not custom DSL)
  • Rust rendering engine (60fps, dirty rect diffing)
  • Rich widget library (Table, Tree, Dialog)
  • Animation engine (tweens, keyframes)
  • Theme system (CSS variables, dark mode)
  • Mouse support (click, scroll, drag)
  • Clipboard integration (copy/paste)

None. BetterTUI is designed as a drop-in replacement for Ink.

Expect significant performance improvements:

  • Rendering: Native Rust vs JavaScript
  • Layout: Taffy flexbox vs custom implementation
  • Memory: ~60% reduction in typical apps
  • Startup: ~40% faster cold start