File: use-stdout.md | Updated: 11/16/2025
useStdout is a React hook that exposes the stdout stream where Ink renders your app.
import {useStdout} from 'ink';
const Example = () => {
const {stdout} = useStdout();
return …
};
See additional usage example in examples/use-stdout.
Type: stream.Writable
Default: process.stdout
Write any string to stdout while preserving Ink's output.
It's useful when you want to display external information outside of Ink's rendering and ensure there's no conflict between the two.
It's similar to <Static>, except it can't accept components; it only works with strings.
Type: string
Data to write to stdout.
import {useStdout} from 'ink';
const Example = () => {
const {write} = useStdout();
useEffect(() => {
// Write a single message to stdout, above Ink's output
write('Hello from Ink to stdout\n');
}, []);
return …
};