Claude Code's UI is built from React components that render to the terminal via the custom Ink reconciler. Components are organized by domain (messages, permissions, tasks, input, MCP, diffs, and dialogs), each providing a self-contained piece of the interface.
Component Categories
The message rendering system handles the conversation display:
Message: renders a single conversation message (user, assistant, system, or tool result) with appropriate styling and content blocksMessageRow: wraps a message with metadata (timestamp, token count, model name) and layoutVirtualMessageList: virtualized scrollable list of messages. Only renders messages visible in the viewport, with aJumpHandleref for programmatic scrolling. Handles scroll-to-bottom behavior and search highlighting
Messages support rich content including code blocks with syntax highlighting, markdown rendering, images (via terminal image protocols), and collapsible tool use/result pairs.
Design System
The design system provides foundational components used throughout the application:
/doctor and settings screens.State Integration
Components access and update state through two primary hooks:
// Read AppState reactively (re-renders on change)
const appState = useAppState()
// Get the setter for AppState updates
const setAppState = useSetAppState()
// Update state immutably
setAppState(prev => ({
...prev,
thinkingEnabled: true,
}))Components also use the useKeybinding and useKeybindings hooks from the keybindings system for keyboard shortcut handling, and useTerminalSize for responsive layout.
Rendering Hooks
Several custom hooks support the rendering pipeline: