Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
ainergiz avatar

Opentui

  • 7 installs
  • 11 repo stars
  • Updated March 8, 2026
  • ainergiz/xfeed

opentui is a Claude Code skill that teaches building terminal UIs with OpenTUI's React renderer using Yoga layout.

About

opentui is a Claude Code skill that teaches building terminal UIs with OpenTUI's React renderer. It covers the lowercase JSX intrinsics (box, text, scrollbox), keyboard handling with useKeyboard, the scrollbox API, flex layout via Yoga, and screen navigation. Developers use it when creating terminal-based UI screens and components in React.

  • React renderer for terminal UIs using OpenTUI and Yoga layout
  • Covers JSX intrinsics, useKeyboard, scrollbox, and focus patterns
  • Screen navigation and scroll-position preservation patterns

Opentui by the numbers

  • 7 all-time installs (skills.sh)
  • Ranked #1,756 of 2,244 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

opentui capabilities & compatibility

Capabilities
terminal ui building · keyboard handling · layout
Use cases
frontend · ui design
From the docs

What opentui says it does

OpenTUI is a React renderer for terminal UIs using Yoga layout (like React Native). **NOT React DOM or Ink.**
SKILL.md
Always Check `focused` in Keyboard Handlers
SKILL.md
npx skills add https://github.com/ainergiz/xfeed --skill opentui

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs7
repo stars11
Last updatedMarch 8, 2026
Repositoryainergiz/xfeed

What it does

Build terminal UI screens and components with OpenTUI's React renderer.

Who is it for?

Developers building terminal UI screens and components in React with OpenTUI.

Skip if: Web DOM UIs or Ink-based terminal apps, which use different APIs.

When should I use this skill?

When creating terminal UI screens, components, handling keyboard input, or managing scroll.

What you get

Working terminal UI screens with correct layout, keyboard handling, and scroll preservation.

  • terminal UI screens
  • OpenTUI components

By the numbers

  • 6 JSX intrinsics (box, text, scrollbox, a, input, textarea)
  • OpenTUI version 0.1.69

Files

SKILL.mdMarkdownGitHub ↗

OpenTUI/React Quick Reference

OpenTUI is a React renderer for terminal UIs using Yoga layout (like React Native). NOT React DOM or Ink.

Version Info

  • Current: 0.1.69 (updated), Latest: 0.1.69
  • Context repo: .context/repos/opentui (run bun run sync-context if missing)

Core Imports

import { useKeyboard, useRenderer, useTerminalDimensions } from "@opentui/react";
import type { ScrollBoxRenderable, KeyEvent } from "@opentui/core";

JSX Elements (Lowercase!)

// CORRECT - OpenTUI intrinsics
<box style={{ flexDirection: "column" }}>
  <text fg="#ffffff">Hello</text>
  <scrollbox ref={scrollRef} focused />
</box>

// WRONG - Not OpenTUI
<div>, <span>, <Box>, <Text>
ElementPurposeKey Props
<box>Container/layoutstyle, id, onMouse
<text>Text content (strings only!)fg, bg, selectable
<scrollbox>Scrollable containerref, focused
<a>Hyperlink (OSC8)href, fg
<input>Text inputfocused, onInput, onSubmit
<textarea>Multi-line inputref, focused, placeholder

Critical Rules

1. Text Only Accepts Strings

// WRONG - Cannot nest elements in <text>
<text>Hello <text fg="red">world</text></text>

// CORRECT - Use row box for inline styling
<box style={{ flexDirection: "row" }}>
  <text>Hello </text>
  <text fg="red">world</text>
</box>

2. Always Check focused in Keyboard Handlers

useKeyboard((key) => {
  if (!focused) return;  // MUST check first!
  if (key.name === "j") moveDown();
});

3. Save Scroll Position Synchronously

// WRONG - useEffect runs after render, scroll already reset
useEffect(() => { if (!focused) savedScroll.current = scrollRef.current?.scrollTop; }, [focused]);

// CORRECT - Save before state change
const handleSelect = () => {
  savedScroll.current = scrollRef.current?.scrollTop;  // Save first!
  onSelect(item);
};

Hyperlinks (New in 0.1.64+)

<text>
  Visit <a href="https://example.com">example.com</a> for more
</text>

Renders clickable links in terminals supporting OSC8 (iTerm2, Kitty, etc.).

Key Names

Keykey.nameKeykey.name
Enter"return"Arrows"up", "down", "left", "right"
Escape"escape"Letters"a", "b", "j", "k"
Tab"tab"Shift+Letter"A", "B", "G"

Scrollbox API

const scrollbox = scrollRef.current;
scrollbox.scrollTop           // Current position
scrollbox.scrollHeight        // Total content height
scrollbox.viewport.height     // Visible area
scrollbox.scrollTo(pos)       // Absolute scroll
scrollbox.scrollBy(delta)     // Relative scroll
scrollbox.getChildren()       // Find elements by ID

Common Layout Patterns

// Full-height with fixed header/footer
<box style={{ flexDirection: "column", height: "100%" }}>
  <box style={{ flexShrink: 0 }}>{/* Header */}</box>
  <scrollbox style={{ flexGrow: 1 }}>{/* Content */}</scrollbox>
  <box style={{ flexShrink: 0 }}>{/* Footer */}</box>
</box>

// Prevent unwanted spacing (Yoga quirk)
<box style={{ justifyContent: "flex-start", marginBottom: 0, paddingBottom: 0 }}>

React DevTools (Optional)

bun add --dev react-devtools-core@7
npx react-devtools@7  # Start standalone devtools
DEV=true bun run start  # Run app with devtools enabled

Detailed References

  • COMPONENTS.md - JSX elements, styling, text nesting
  • KEYBOARD.md - Keyboard handling, key names, focus patterns
  • SCROLLBOX.md - Scrollbox API, scroll preservation, windowed lists
  • LAYOUT.md - Flex layout, Yoga engine, spacing issues
  • PATTERNS.md - Screen navigation, state preservation, library compatibility

xfeed Reference Files

  • src/app.tsx - Screen routing, navigation history
  • src/components/PostList.tsx - Scrollbox with preservation
  • src/components/PostCard.tsx - Component styling, mouse handling
  • src/modals/FolderPicker.tsx - Windowed list pattern
  • src/hooks/useListNavigation.ts - Vim-style navigation

Related skills

FAQ

Is OpenTUI the same as Ink?

No, OpenTUI is a distinct React renderer for terminals using Yoga layout, not React DOM or Ink.

Why check focused in keyboard handlers?

Keyboard handlers must return early when the component is not focused so input goes to the right view.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.