import { pageMetadata } from "@/lib/page-metadata"
export const metadata = pageMetadata("docs/api/ink")
# @json-render/ink
Terminal renderer for [Ink](https://github.com/vadimdemedes/ink) with multiple standard components, providers, hooks, and streaming support.
## Installation
| Component | Props | Description |
|---|---|---|
Box | flexDirection, alignItems, justifyContent, gap, padding, margin, borderStyle, borderColor, width, height, display, overflow | Flexbox layout container (like a terminal div) |
Spacer | (none) | Flexible empty space that expands to fill available room |
Newline | count | Insert blank lines |
| Component | Props | Description |
|---|---|---|
Text | text, color, bold, italic, underline, strikethrough, dimColor, inverse, wrap | Text output with styling |
Heading | text, level (h1-h4), color | Section heading |
Divider | character, color, dimColor, title, width | Horizontal separator line with optional title |
Badge | label, variant | Colored inline label (default, info, success, warning, error) |
Spinner | label, color | Animated loading spinner |
ProgressBar | progress (0-1), width, color, label | Horizontal progress bar |
StatusLine | text, status, icon | Status message with colored icon |
KeyValue | label, value, labelColor, separator | Key-value pair display |
Link | url, label, color | Renders a URL as underlined text. Shows "label (url)" when label is provided. |
Markdown | text | Renders markdown with terminal styling (headings, bold, italic, code, lists, blockquotes, horizontal rules) |
| Component | Props | Description |
|---|---|---|
Table | columns, rows, borderStyle, headerColor | Tabular data with headers |
List | items, ordered, bulletChar, spacing | Bulleted or numbered list |
ListItem | title, subtitle, leading, trailing | Structured list row |
Card | title, borderStyle, borderColor, padding | Bordered container with optional title |
Sparkline | data, width, color, label, min, max | Inline sparkline chart using Unicode blocks (▁▂▃▄▅▆▇█) |
BarChart | data (label/value/color), width, showValues, showPercentage | Horizontal bar chart for comparing values |
| Component | Props | Description |
|---|---|---|
TextInput | placeholder, value (use $bindState), label, mask | Text input field. Press Enter to submit. |
Select | options, value (use $bindState), label | Arrow-key selection menu |
MultiSelect | options, value (use $bindState), label, min, max | Multi-selection menu. Space to toggle, Enter to confirm. |
ConfirmInput | message, defaultValue, yesLabel, noLabel | Yes/No confirmation prompt. Press Y or N. |
Tabs | tabs, value (use $bindState), color | Tab bar navigation with left/right arrow keys. Place child content inside with visible conditions. |
| Prop | Type | Description |
|---|---|---|
store | StateStore | External store (controlled mode). When provided, initialState and onStateChange are ignored. |
initialState | Record<string, unknown> | Initial state model (uncontrolled mode). |
onStateChange | {'(changes: Array<{ path: string; value: unknown }>) => void'} | Callback when state changes (uncontrolled mode). |
| Export | Purpose |
|---|---|
standardComponentDefinitions | Catalog definitions for all 19 standard components |
standardActionDefinitions | Catalog definitions for standard actions (setState, pushState, removeState, log, exit) |
schema | Ink element tree schema |