Skip to content

React component kit for terminal UIs with three skills covering patterns, hooks, and Flexbox layout.

CCM score
48 of 100
GitHub stars
201
View on GitHub

Own this plugin? Claim it

What it does

  • Adds 3 skills (ink-component-patterns, ink-hooks-state, ink-layout-styling) for building React-based terminal interfaces with TypeScript
  • Covers built-in components like Box and Text, plus useState, useEffect, useInput, and useStdout for keyboard and dimension handling
  • Guides Flexbox layout with margin, padding, borders, min and max constraints, and responsive grid and card patterns
  • Designed for CLI tools, build progress displays, and real-time terminal dashboards built on Ink

Advanced Ink skills for building beautiful terminal UIs with React components, hooks, and Flexbox layouts.

Add marketplace

/plugin marketplace add TheBushidoCollective/han

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install ink@han

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

Ink Component Patterns

You are an expert in building terminal UIs with Ink, React for the terminal.

Core Principles

  • Use functional components with TypeScript for type safety
  • Leverage Ink's built-in components (Box, Text, Newline, Spacer)
  • Keep components focused and composable
  • Use proper prop types and interfaces
  • Handle terminal resizing gracefully

Component Structure

Basic Component

import { Box, Text } from 'ink';
import React from 'react';

interface MyComponentProps {
  title: string;
  items: string[];
}

export const MyComponent: React.FC<MyComponentProps> = ({ title, items }) => {
  return (
    <Box flexDirection="column">
      <Text bold color="cyan">
        {title}
      </Text>
      {items.map((item, index) => (
        <Box key={index} marginLeft={2}>
          <Text>• {item}</Text>
        </Box>
      ))}
    </Box>
  );
};

Layout Patterns

Vertical Stack
<Box flexDirection="column">
  <Text>First item</Text>
  <Text>Second item</Text>
</Box>
Horizontal Row
<Box>
  <Text>Left</Text>
  <Spacer />
  <Text>Right</Text>
</Box>
Centered Content
<Box justifyContent="center" alignItems="center" height={10}>
  <Text>Centered content</Text>
</Box>
Padded Container
<Box padding={1} borderStyle="round" borderColor="cyan">
  <Text>Content with border and padding</Text>
</Box>

Common Patterns

List with Icons

interface ListItem {
  icon: string;
  label: string;
  value: string;
}

const List: React.FC<{ items: ListItem[] }> = ({ items }) => (
  <Box flexDirection="column">
    {items.map((item, i) => (
      <Box key={i}>
        <Text color="yellow">{item.icon} </Text>
        <Text bold>{item.label}: </Text>
        <Text>{item.value}</Text>
      </Box>
    ))}
  </Box>
);

Status Messages

const StatusMessage: React.FC<{ type: 'success' | 'error' | 'warning'; message: string }> = ({
  type,
  message,
}) => {
  const config = {
    success: { icon: '✅', color: 'green' },
    error: { icon: '❌', color: 'red' },
    warning: { icon: '⚠️', color: 'yellow' },
  };

  const { icon, color } = config[type];

  return (
    <Box>
      <Text color={color}>
        {icon} {message}
      </Text>
    </Box>
  );
};

Progress Indicator

const ProgressIndicator: React.FC<{ current: number; total: number; label: string }> = ({
  current,
  total,
  label,
}) => (
  <Box>
    <Text color="blue">
      {label}: {current}/{total}
    </Text>
  </Box>
);

Collapsible Section

const CollapsibleSection: React.FC<{ title: string; isOpen: boolean; children: React.ReactNode }> = ({
  title,
  isOpen,
  children,
}) => (
  <Box flexDirection="column">
    <Text bold>
      {isOpen ? '▼' : '▶'} {title}
    </Text>
    {isOpen && <Box marginLeft={2}>{children}</Box>}
  </Box>
);

Best Practices

  1. Type Safety: Always define prop interfaces
  2. Performance: Use React.memo for expensive renders
  3. Accessibility: Use semantic structure and clear labels
  4. Error Boundaries: Wrap components in error boundaries
  5. Testing: Test components with ink-testing-library

Anti-Patterns to Avoid

  • Don't use DOM-specific APIs (document, window)
  • Don't use CSS classes or inline styles (use Ink props)
  • Don't mutate terminal state directly
  • Don't forget to handle edge cases (empty arrays, null values)
  • Don't create deeply nested component trees (keep it flat)

Readme

Ink

Advanced Ink skills for building beautiful, interactive terminal UIs with React.

Overview

Ink is React for the terminal - it lets you build interactive command-line apps using React components. This plugin provides comprehensive skills for creating production-quality terminal interfaces.

Skills Included

ink-component-patterns

Master component architecture and common patterns for terminal UIs:

  • Functional components with TypeScript
  • Built-in components (Box, Text, Newline, Spacer)
  • Layout patterns (vertical stack, horizontal row, centered content)
  • Common UI patterns (lists, status messages, progress indicators)
  • Collapsible sections and interactive components
  • Best practices and anti-patterns

ink-hooks-state

Advanced state management and React hooks for Ink applications:

  • Core hooks (useState, useEffect, useRef)
  • Ink-specific hooks (useInput, useApp, useStdout, useFocus)
  • Custom hooks for common patterns
  • Async state management
  • Promise-based flow control
  • Keyboard input handling
  • Terminal dimension detection

ink-layout-styling

Create beautiful layouts with Flexbox and styling:

  • Flexbox-based layout with Box component
  • Spacing (margin, padding, directional spacing)
  • Alignment and justification
  • Dimensions (width, height, min/max constraints)
  • Borders and border styles
  • Text styling (colors, formatting, wrapping)
  • Layout patterns (cards, split layouts, headers/footers, grids)
  • Responsive layouts
  • Utility components

Use Cases

  • CLI Tools: Build interactive command-line applications
  • Developer Tools: Create rich terminal interfaces for development workflows
  • Build Systems: Display build progress and status
  • Package Managers: Show installation progress and package information
  • Testing Frameworks: Display test results with beautiful formatting
  • Monitoring Tools: Real-time dashboards in the terminal

Example: Simple Status Display

import { Box, Text } from 'ink';
import React, { useState, useEffect } from 'react';

interface StatusProps {
  onComplete: () => void;
}

const Status: React.FC<StatusProps> = ({ onComplete }) => {
  const [phase, setPhase] = useState<'loading' | 'complete'>('loading');

  useEffect(() => {
    setTimeout(() => {
      setPhase('complete');
      onComplete();
    }, 2000);
  }, [onComplete]);

  return (
    <Box flexDirection="column" padding={1}>
      <Box marginBottom={1}>
        <Text bold color="cyan">
          🚀 My CLI App
        </Text>
      </Box>

      {phase === 'loading' && (
        <Text color="yellow">⏳ Loading...</Text>
      )}

      {phase === 'complete' && (
        <Box flexDirection="column">
          <Text color="green">✅ Complete!</Text>
          <Box marginTop={1}>
            <Text color="blue">💡 Next steps here</Text>
          </Box>
        </Box>
      )}
    </Box>
  );
};

Integration with TypeScript

All skills emphasize TypeScript best practices:

  • Proper prop type definitions
  • Interface-based component APIs
  • Type-safe event handlers
  • Generic hooks for reusable logic

Resources

Real-World Examples

This plugin's patterns are used in production tools like:

  • npx create-next-app - Next.js project scaffolding
  • npm - Package manager output
  • gatsby - Build progress and development server
  • @anthropic-ai/claude-agent-sdk - Claude agent development

Installation

Install via the han CLI:

han plugin install ink

Details

Marketplace
TheBushidoCollective/han
Source
plugins/frameworks/ink
Category
Framework
Keywords
ink, terminal, cli, react, ui, skill
Listed since
Apr 7, 2026

More from TheBushidoCollective/han

All 340

Similar to ink

More CLI & Terminal