A React Ink component for prompts
npm install ink-promptA React Ink component library focused on terminal-friendly prompts. The first
export is MultilineInput, an Ink component for collecting multi-line text in
CLIs.
``bash`
npm install ink-prompt
`tsx
import React from 'react';
import { render, Box, Text } from 'ink';
import { MultilineInput } from 'ink-prompt';
const App = () => {
return (
width={80}
/>
);
};
render(
`
MultilineInput supports typical editing controls:
- Arrow keys for navigation
- Ctrl+J or typing \ before Enter to add a newlineCtrl+Z
- /Ctrl+Y for undo/redo
- Enter submits the current buffer
`bashInstall dependencies
npm install
MIT