giggles
giggles is a batteries-included react framework for building terminal apps. built on ink, it handles focus, input routing, screen navigation, and theming out of the box so you can skip the plumbing and build.
inspired by the charmbracelet ecosystem, it comes with a rich set of UI components, hooks for focus and navigation management, and terminal utilities for things like running shell commands.
features
- each component owns its keys — a text input inside a list inside a panel all work independently, with unhandled keys naturally passing up to the right parent. no global input handler, no coordination code
- navigate between views with a simple API; the previously focused component is restored when you return
- a full set of hooks and components —
useFocusScope,useFocusNode,FocusTrap,useNavigation, and more — for building any interaction pattern without reimplementing the plumbing - built-in keybinding registry so your app can always show users what keys do what, in the current context — context-aware and accessible via a hook
- a component library covering most TUI use cases, from text inputs and autocomplete to virtual lists for large datasets — with sensible defaults and render props for full customization
- render markdown in the terminal, with full formatting and syntax-highlighted code block and diff support
- hand off terminal control to external programs like
vimorlessand reclaim it cleanly when they exit, or spawn processes and stream their output directly into your UI - a consistent look out of the box, customizable from a single theme object
your first TUI
to get started, run
npx create-giggles-app
see giggles.zzzzion.com for API documentation and live demos.
giggles/ui
select
multi select
markdown
text input
viewport
code block
confirm
spinner
modal
paginator
autocomplete
command palette
virtual list
badge
panel
giggles/terminal
useShellOut
suspend the UI, hand off the terminal to an external program like vim or less, and resume cleanly when it exits
useSpawn
spawn a child process and stream its stdout/stderr output into your UI — with support for colored output via a pty
useTerminalSize
reactively track the terminal's current dimensions (rows and columns), updating on resize
useTerminalFocus
detect when the terminal window gains or loses focus