/
1.1k
Sponsor

App Shell

Full-screen TUI layout with header, tip bar, full-width input, scrollable content, and hints footer

Terminal

Installation

$ pnpm dlx shadcn@latest add @termcn/ink/app-shell

Usage

import { AppShell } from "@/components/ui/app-shell";
<AppShell>
  <AppShell.Header>
    <AppShell.Tip>
      Press Tab to move between the command input and output
    </AppShell.Tip>
  </AppShell.Header>
  <AppShell.Input
    autoFocus
    placeholder="Enter a command..."
    prefix="$"
    onSubmit={(value) => console.log(value)}
  />
  <AppShell.Content height={16}></AppShell.Content>
  <AppShell.Hints items={["tab focus", "enter submit", "↑↓ scroll"]} />
</AppShell>

API Reference

AppShell

PropTypeDefault
childrenReactNoderequired
fullscreenboolean-

AppShell.Header

PropTypeDefault
childrenReactNoderequired

AppShell.Tip

PropTypeDefault
childrenReactNoderequired

AppShell.Input

PropTypeDefault
valuestring-
defaultValuestring""
onValueChange(value: string) => void-
onChange(value: string) => void-
onSubmit(value: string) => void-
placeholderstring"Type something..."
borderStyle"single" | "double" | "round" | "bold""single"
borderColorstring-
prefixstring">"
readOnlybooleanfalse
requiredbooleanfalse
cursorOrigin{x: number; y: number}-
idstringgenerated
autoFocusbooleanfalse
isActivebooleantrue
disabledbooleanfalse

AppShell.Content

PropTypeDefault
childrenReactNoderequired
autoscrollboolean-
heightnumber20

AppShell.Hints

PropTypeDefault
itemsstring[]-
childrenReactNode-

Notes

Accessibility

termcn exposes the following behavior through Ink's terminal accessibility APIs. This is not a browser ARIA or general WCAG-conformance claim.

  • Keyboard: Left / Right move by grapheme, Home / End move to the boundaries, and Backspace / Delete remove one complete grapheme. Enter submits or confirms (Ctrl+Enter in TextArea); Tab / Shift+Tab leave through Ink focus traversal.
  • Focus and composition: Input is active only while the component's focus target is focused, enabled, active, and inside the topmost focus scope.
  • Screen reader: Ink labels and semantic state expose the component without relying on visual styling alone.