--- title: React description: Build terminal UIs with React and OpenTUI order: 2 skill: entry: true intents: [react, jsx, hooks, keyboard, paste, focus, blur, selection, animation, testing] --- # React bindings Build terminal user interfaces using React with familiar patterns and components. ## Installation Quick start with [bun](https://bun.sh) and [create-tui](https://github.com/msmps/create-tui): ```bash bun create tui --template react ``` Manual installation: ```bash bun install @opentui/react @opentui/core react ``` ## Quick start ```tsx import { createCliRenderer } from "@opentui/core" import { createRoot } from "@opentui/react" function App() { return Hello, world! } const renderer = await createCliRenderer() createRoot(renderer).render() ``` ## TypeScript configuration Configure your `tsconfig.json`: ```json { "compilerOptions": { "lib": ["ESNext", "DOM"], "target": "ESNext", "module": "ESNext", "moduleResolution": "bundler", "jsx": "react-jsx", "jsxImportSource": "@opentui/react", "strict": true, "skipLibCheck": true } } ``` ## Runtime-loaded plugin support (if needed) If your app loads external TS/TSX modules at runtime (for example a file-based plugin system), import this once in your app entry before dynamic imports: ```ts import "@opentui/react/runtime-plugin-support" ``` Use this for both normal Bun runs and standalone compiled executables. ## Components OpenTUI React provides JSX intrinsic elements that map to core renderables: ### Layout & display - `` - Text display with styling - `` - Container with borders and layout - `` - Scrollable container - `` - ASCII art text QR code support is available from `@opentui/qrcode/react` and must be registered explicitly with `registerQRCode()`. ### Input - `` - Single-line text input - `