From 7451cd4cd6b7523c5d67bb9e3d7351ae767b8de8 Mon Sep 17 00:00:00 2001 From: Yunfei He Date: Mon, 8 Jun 2026 19:55:17 +0800 Subject: [PATCH] docs: add usePaste/useBoxMetrics/useCursor/useAnimation to README composables The composables table was missing four exported composables. Add them and note that `useTerminalSize` is also exported under Ink's `useWindowSize` name. Co-Authored-By: Claude Opus 4.8 (1M context) --- README.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9a68af5..451f94a 100644 --- a/README.md +++ b/README.md @@ -111,16 +111,20 @@ useInput((input) => { ## Composables (Hooks) -| Composable | Description | -| -------------------------- | ------------------------------------------------------------------------------------- | -| `useInput(handler, opts?)` | Handle keyboard input — receives `(input, key)` with modifier and arrow key detection | -| `useFocus(opts?)` | Component-level focus — returns `{ isFocused, focus }` | -| `useFocusManager()` | App-level focus control — `focusNext()`, `focusPrevious()`, `focus(id)` | -| `useApp()` | App lifecycle — `{ exit(error?), waitUntilRenderFlush() }` | -| `useTerminalSize()` | Reactive terminal dimensions — `{ columns, rows }` | -| `useStdin()` | Access stdin stream and raw mode control | -| `useStdout()` | Write directly to stdout | -| `useStderr()` | Write directly to stderr | +| Composable | Description | +| -------------------------- | -------------------------------------------------------------------------------------- | +| `useInput(handler, opts?)` | Handle keyboard input — receives `(input, key)` with modifier and arrow key detection | +| `usePaste(handler, opts?)` | Handle bracketed paste — receives the pasted `text` as a single event | +| `useFocus(opts?)` | Component-level focus — returns `{ isFocused, focus }` | +| `useFocusManager()` | App-level focus control — `focusNext()`, `focusPrevious()`, `focus(id)` | +| `useApp()` | App lifecycle — `{ exit(error?), waitUntilRenderFlush() }` | +| `useTerminalSize()` | Reactive terminal dimensions — `{ columns, rows }` (Ink-compat alias: `useWindowSize`) | +| `useStdin()` | Access stdin stream and raw mode control | +| `useStdout()` | Write directly to stdout | +| `useStderr()` | Write directly to stderr | +| `useBoxMetrics(ref)` | Measure a `` via a template ref — reactive `{ width, height, left, top }` | +| `useCursor()` | Control the terminal cursor — `setCursorPosition(pos)` in output coordinates | +| `useAnimation(opts?)` | Frame-based animation driver — reactive `{ frame, time, delta }` + `reset()` | ## Testing