` in the browser.\n```js\nimport {render, Box, Text} from 'ink';\nconst Example = () => (\n\t
\n\t\tThis is a box with margin\n\t\n);\nrender(
);\n```\n#### Dimensions\n[](#dimensions)\n##### width\n[](#width)\nType: `number` `string`\nWidth of the element in spaces. You can also set it as a percentage, which will calculate the width based on the width of the parent element.\n```js\n
\n\tX\n\n//=> 'X '\n```\n```js\n
\n\t\n\t\tX\n\t\n\tY\n\n//=> 'X Y'\n```\n##### height\n[](#height)\nType: `number` `string`\nHeight of the element in lines (rows). You can also set it as a percentage, which will calculate the height based on the height of the parent element.\n```js\n
\n\tX\n\n//=> 'X\\n\\n\\n'\n```\n```js\n
\n\t\n\t\tX\n\t\n\tY\n\n//=> 'X\\n\\n\\nY\\n\\n'\n```\n##### minWidth\n[](#minwidth)\nType: `number`\nSets a minimum width of the element. Percentages aren't supported yet; see [facebook/yoga#872](https://github.com/facebook/yoga/issues/872).\n##### minHeight\n[](#minheight)\nType: `number`\nSets a minimum height of the element. Percentages aren't supported yet; see [facebook/yoga#872](https://github.com/facebook/yoga/issues/872).\n#### Padding\n[](#padding)\n##### paddingTop\n[](#paddingtop)\nType: `number`\nDefault: `0`\nTop padding.\n##### paddingBottom\n[](#paddingbottom)\nType: `number`\nDefault: `0`\nBottom padding.\n##### paddingLeft\n[](#paddingleft)\nType: `number`\nDefault: `0`\nLeft padding.\n##### paddingRight\n[](#paddingright)\nType: `number`\nDefault: `0`\nRight padding.\n##### paddingX\n[](#paddingx)\nType: `number`\nDefault: `0`\nHorizontal padding. Equivalent to setting `paddingLeft` and `paddingRight`.\n##### paddingY\n[](#paddingy)\nType: `number`\nDefault: `0`\nVertical padding. Equivalent to setting `paddingTop` and `paddingBottom`.\n##### padding\n[](#padding-1)\nType: `number`\nDefault: `0`\nPadding on all sides. Equivalent to setting `paddingTop`, `paddingBottom`, `paddingLeft` and `paddingRight`.\n```js\n
Top\n
Bottom\n
Left\n
Right\n
Left and right\n
Top and bottom\n
Top, bottom, left and right\n```\n#### Margin\n[](#margin)\n##### marginTop\n[](#margintop)\nType: `number`\nDefault: `0`\nTop margin.\n##### marginBottom\n[](#marginbottom)\nType: `number`\nDefault: `0`\nBottom margin.\n##### marginLeft\n[](#marginleft)\nType: `number`\nDefault: `0`\nLeft margin.\n##### marginRight\n[](#marginright)\nType: `number`\nDefault: `0`\nRight margin.\n##### marginX\n[](#marginx)\nType: `number`\nDefault: `0`\nHorizontal margin. Equivalent to setting `marginLeft` and `marginRight`.\n##### marginY\n[](#marginy)\nType: `number`\nDefault: `0`\nVertical margin. Equivalent to setting `marginTop` and `marginBottom`.\n##### margin\n[](#margin-1)\nType: `number`\nDefault: `0`\nMargin on all sides. Equivalent to setting `marginTop`, `marginBottom`, `marginLeft` and `marginRight`.\n```js\n
Top\n
Bottom\n
Left\n
Right\n
Left and right\n
Top and bottom\n
Top, bottom, left and right\n```\n#### Gap\n[](#gap)\n#### gap\n[](#gap-1)\nType: `number`\nDefault: `0`\nSize of the gap between an element's columns and rows. A shorthand for `columnGap` and `rowGap`.\n```js\n
\n\tA\n\tB\n\tC\n\n// A B\n//\n// C\n```\n#### columnGap\n[](#columngap)\nType: `number`\nDefault: `0`\nSize of the gap between an element's columns.\n```js\n
\n\tA\n\tB\n\n// A B\n```\n#### rowGap\n[](#rowgap)\nType: `number`\nDefault: `0`\nSize of the gap between an element's rows.\n```js\n
\n\tA\n\tB\n\n// A\n//\n// B\n```\n#### Flex\n[](#flex)\n##### flexGrow\n[](#flexgrow)\nType: `number`\nDefault: `0`\nSee [flex-grow](https://css-tricks.com/almanac/properties/f/flex-grow/).\n```js\n
\n\tLabel:\n\t\n\t\tFills all remaining space\n\t\n\n```\n##### flexShrink\n[](#flexshrink)\nType: `number`\nDefault: `1`\nSee [flex-shrink](https://css-tricks.com/almanac/properties/f/flex-shrink/).\n```js\n
\n\t\n\t\tWill be 1/4\n\t\n\t\n\t\tWill be 3/4\n\t\n\n```\n##### flexBasis\n[](#flexbasis)\nType: `number` `string`\nSee [flex-basis](https://css-tricks.com/almanac/properties/f/flex-basis/).\n```js\n
\n\t\n\t\tX\n\t\n\tY\n\n//=> 'X Y'\n```\n```js\n
\n\t\n\t\tX\n\t\n\tY\n\n//=> 'X Y'\n```\n##### flexDirection\n[](#flexdirection)\nType: `string`\nAllowed values: `row` `row-reverse` `column` `column-reverse`\nSee [flex-direction](https://css-tricks.com/almanac/properties/f/flex-direction/).\n```js\n
\n\t\n\t\tX\n\t\n\tY\n\n// X Y\n
\n\tX\n\t\n\t\tY\n\t\n\n// Y X\n
\n\tX\n\tY\n\n// X\n// Y\n
\n\tX\n\tY\n\n// Y\n// X\n```\n##### flexWrap\n[](#flexwrap)\nType: `string`\nAllowed values: `nowrap` `wrap` `wrap-reverse`\nSee [flex-wrap](https://css-tricks.com/almanac/properties/f/flex-wrap/).\n```js\n
\n\tA\n\tBC\n\n// A\n// B C\n```\n```js\n
\n\tA\n\tB\n\tC\n\n// A C\n// B\n```\n##### alignItems\n[](#alignitems)\nType: `string`\nAllowed values: `flex-start` `center` `flex-end`\nSee [align-items](https://css-tricks.com/almanac/properties/a/align-items/).\n```js\n
\n\t\n\t\tX\n\t\n\t\n\t\tA\n\t\t\n\t\tB\n\t\t\n\t\tC\n\t\n\n// X A\n// B\n// C\n
\n\t\n\t\tX\n\t\n\t\n\t\tA\n\t\t\n\t\tB\n\t\t\n\t\tC\n\t\n\n// A\n// X B\n// C\n
\n\t\n\t\tX\n\t\n\t\n\t\tA\n\t\t\n\t\tB\n\t\t\n\t\tC\n\t\n\n// A\n// B\n// X C\n```\n##### alignSelf\n[](#alignself)\nType: `string`\nDefault: `auto`\nAllowed values: `auto` `flex-start` `center` `flex-end`\nSee [align-self](https://css-tricks.com/almanac/properties/a/align-self/).\n```js\n
\n\t\n\t\tX\n\t\n\n// X\n//\n//\n
\n\t\n\t\tX\n\t\n\n//\n// X\n//\n
\n\t\n\t\tX\n\t\n\n//\n//\n// X\n```\n##### justifyContent\n[](#justifycontent)\nType: `string`\nAllowed values: `flex-start` `center` `flex-end` `space-between` `space-around` `space-evenly`\nSee [justify-content](https://css-tricks.com/almanac/properties/j/justify-content/).\n```js\n
\n\tX\n\n// [X ]\n
\n\tX\n\n// [ X ]\n
\n\tX\n\n// [ X]\n
\n\tX\n\tY\n\n// [X Y]\n
\n\tX\n\tY\n\n// [ X Y ]\n
\n\tX\n\tY\n\n// [ X Y ]\n```\n#### Visibility\n[](#visibility)\n##### display\n[](#display)\nType: `string`\nAllowed values: `flex` `none`\nDefault: `flex`\nSet this property to `none` to hide the element.\n##### overflowX\n[](#overflowx)\nType: `string`\nAllowed values: `visible` `hidden`\nDefault: `visible`\nBehavior for an element's overflow in the horizontal direction.\n##### overflowY\n[](#overflowy)\nType: `string`\nAllowed values: `visible` `hidden`\nDefault: `visible`\nBehavior for an element's overflow in the vertical direction.\n##### overflow\n[](#overflow)\nType: `string`\nAllowed values: `visible` `hidden`\nDefault: `visible`\nA shortcut for setting `overflowX` and `overflowY` at the same time.\n#### Borders\n[](#borders)\n##### borderStyle\n[](#borderstyle)\nType: `string`\nAllowed values: `single` `double` `round` `bold` `singleDouble` `doubleSingle` `classic` | `BoxStyle`\nAdd a border with a specified style. If `borderStyle` is `undefined` (the default), no border will be added. Ink uses border styles from the [`cli-boxes`](https://github.com/sindresorhus/cli-boxes) module.\n```js\n
\n\t\n\t\t\n\t\t\tsingle\n\t\t\n\t\t\n\t\t\tdouble\n\t\t\n\t\t\n\t\t\tround\n\t\t\n\t\t\n\t\t\tbold\n\t\t\n\t\n\t\n\t\t\n\t\t\tsingleDouble\n\t\t\n\t\t\n\t\t\tdoubleSingle\n\t\t\n\t\t\n\t\t\tclassic\n\t\t\n\t\n\n```\n[](https://github.com/vadimdemedes/ink/blob/master/media/box-borderStyle.jpg)\nAlternatively, pass a custom border style like so:\n```js\n
\n\tCustom\n\n```\nSee example in [examples/borders](https://github.com/vadimdemedes/ink/blob/master/examples/borders/borders.tsx).\n##### borderColor\n[](#bordercolor)\nType: `string`\nChange border color. A shorthand for setting `borderTopColor`, `borderRightColor`, `borderBottomColor`, and `borderLeftColor`.\n```js\n
\n\tGreen Rounded Box\n\n```\n[](https://github.com/vadimdemedes/ink/blob/master/media/box-borderColor.jpg)\n##### borderTopColor\n[](#bordertopcolor)\nType: `string`\nChange top border color. Accepts the same values as [`color`](#color) in `
` component.\n```js\n\n\tHello world\n\n```\n##### borderRightColor\n[](#borderrightcolor)\nType: `string`\nChange right border color. Accepts the same values as [`color`](#color) in `` component.\n```js\n\n\tHello world\n\n```\n##### borderBottomColor\n[](#borderbottomcolor)\nType: `string`\nChange bottom border color. Accepts the same values as [`color`](#color) in `` component.\n```js\n\n\tHello world\n\n```\n##### borderLeftColor\n[](#borderleftcolor)\nType: `string`\nChange left border color. Accepts the same values as [`color`](#color) in `` component.\n```js\n\n\tHello world\n\n```\n##### borderDimColor\n[](#borderdimcolor)\nType: `boolean`\nDefault: `false`\nDim the border color. A shorthand for setting `borderTopDimColor`, `borderBottomDimColor`, `borderLeftDimColor`, and `borderRightDimColor`.\n```js\n\n\tHello world\n\n```\n##### borderTopDimColor\n[](#bordertopdimcolor)\nType: `boolean`\nDefault: `false`\nDim the top border color.\n```js\n\n\tHello world\n\n```\n##### borderBottomDimColor\n[](#borderbottomdimcolor)\nType: `boolean`\nDefault: `false`\nDim the bottom border color.\n```js\n\n\tHello world\n\n```\n##### borderLeftDimColor\n[](#borderleftdimcolor)\nType: `boolean`\nDefault: `false`\nDim the left border color.\n```js\n\n\tHello world\n\n```\n##### borderRightDimColor\n[](#borderrightdimcolor)\nType: `boolean`\nDefault: `false`\nDim the right border color.\n```js\n\n\tHello world\n\n```\n##### borderTop\n[](#bordertop)\nType: `boolean`\nDefault: `true`\nDetermines whether top border is visible.\n##### borderRight\n[](#borderright)\nType: `boolean`\nDefault: `true`\nDetermines whether right border is visible.\n##### borderBottom\n[](#borderbottom)\nType: `boolean`\nDefault: `true`\nDetermines whether bottom border is visible.\n##### borderLeft\n[](#borderleft)\nType: `boolean`\nDefault: `true`\nDetermines whether left border is visible.\n#### Background\n[](#background)\n##### backgroundColor\n[](#backgroundcolor-1)\nType: `string`\nBackground color for the element.\nAccepts the same values as [`color`](#color) in the `` component.\n```js\n\n\t\n\t\tRed background\n\t\n\t\n\t\tOrange background\n\t\n\t\n\t\tGreen background\n\t\n\n```\nThe background color fills the entire `` area and is inherited by child `` components unless they specify their own `backgroundColor`.\n```js\n\n\tBlue inherited \n\tYellow override \n\tBlue inherited again\n\n```\nBackground colors work with borders and padding:\n```js\n\n\tBackground with border and padding\n\n```\nSee example in [examples/box-backgrounds](https://github.com/vadimdemedes/ink/blob/master/examples/box-backgrounds/box-backgrounds.tsx).\n### ``\n[](#newline)\nAdds one or more newline (`\\n`) characters. Must be used within `` components.\n#### count\n[](#count)\nType: `number`\nDefault: `1`\nNumber of newlines to insert.\n```js\nimport {render, Text, Newline} from 'ink';\nconst Example = () => (\n\t\n\t\tHello\n\t\t\n\t\tWorld\n\t\n);\nrender();\n```\nOutput:\n```\nHello\nWorld\n```\n### ``\n[](#spacer)\nA flexible space that expands along the major axis of its containing layout. It's useful as a shortcut for filling all the available space between elements.\nFor example, using `` in a `` with default flex direction (`row`) will position \"Left\" on the left side and will push \"Right\" to the right side.\n```js\nimport {render, Box, Text, Spacer} from 'ink';\nconst Example = () => (\n\t\n\t\tLeft\n\t\t\n\t\tRight\n\t\n);\nrender();\n```\nIn a vertical flex direction (`column`), it will position \"Top\" at the top of the container and push \"Bottom\" to the bottom. Note that the container needs to be tall enough to see this in effect.\n```js\nimport {render, Box, Text, Spacer} from 'ink';\nconst Example = () => (\n\t\n\t\tTop\n\t\t\n\t\tBottom\n\t\n);\nrender();\n```\n### ``\n[](#static)\n`` component permanently renders its output above everything else. It's useful for displaying activity like completed tasks or logs - things that don't change after they're rendered (hence the name \"Static\").\nIt's preferred to use `` for use cases like these when you can't know or control the number of items that need to be rendered.\nFor example, [Tap](https://github.com/tapjs/node-tap) uses `` to display a list of completed tests. [Gatsby](https://github.com/gatsbyjs/gatsby) uses it to display a list of generated pages while still displaying a live progress bar.\n```js\nimport React, {useState, useEffect} from 'react';\nimport {render, Static, Box, Text} from 'ink';\nconst Example = () => {\n\tconst [tests, setTests] = useState([]);\n\tuseEffect(() => {\n\t\tlet completedTests = 0;\n\t\tlet timer;\n\t\tconst run = () => {\n\t\t\t// Fake 10 completed tests\n\t\t\tif (completedTests++ < 10) {\n\t\t\t\tsetTests(previousTests => [\n\t\t\t\t\t...previousTests,\n\t\t\t\t\t{\n\t\t\t\t\t\tid: previousTests.length,\n\t\t\t\t\t\ttitle: `Test #${previousTests.length + 1}`\n\t\t\t\t\t}\n\t\t\t\t]);\n\t\t\t\ttimer = setTimeout(run, 100);\n\t\t\t}\n\t\t};\n\t\trun();\n\t\treturn () => {\n\t\t\tclearTimeout(timer);\n\t\t};\n\t}, []);\n\treturn (\n\t\t<>\n\t\t\t{/* This part will be rendered once to the terminal */}\n\t\t\t\n\t\t\t\t{test => (\n\t\t\t\t\t\n\t\t\t\t\t\t✔ {test.title}\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\n\t\t\t{/* This part keeps updating as state changes */}\n\t\t\t\n\t\t\t\tCompleted tests: {tests.length}\n\t\t\t\n\t\t>\n\t);\n};\nrender();\n```\n**Note:** `` only renders new items in the `items` prop and ignores items that were previously rendered. This means that when you add new items to the `items` array, changes you make to previous items will not trigger a rerender.\nSee [examples/static](https://github.com/vadimdemedes/ink/blob/master/examples/static/static.tsx) for an example usage of `` component.\n#### items\n[](#items)\nType: `Array`\nArray of items of any type to render using the function you pass as a component child.\n#### style\n[](#style)\nType: `object`\nStyles to apply to a container of child elements. See [``](#box) for supported properties.\n```js\n\n\t{...}\n\n```\n#### children(item)\n[](#childrenitem)\nType: `Function`\nFunction that is called to render every item in the `items` array. The first argument is the item itself, and the second argument is the index of that item in the `items` array.\nNote that a `key` must be assigned to the root component.\n```js\n\n\t{(item, index) => {\n\t\t// This function is called for every item in ['a', 'b', 'c']\n\t\t// `item` is 'a', 'b', 'c'\n\t\t// `index` is 0, 1, 2\n\t\treturn (\n\t\t\t\n\t\t\t\tItem: {item}\n\t\t\t\n\t\t);\n\t}}\n\n```\n### ``\n[](#transform)\nTransform a string representation of React components before they're written to output. For example, you might want to apply a [gradient to text](https://github.com/sindresorhus/ink-gradient), [add a clickable link](https://github.com/sindresorhus/ink-link), or [create some text effects](https://github.com/sindresorhus/ink-big-text). These use cases can't accept React nodes as input; they expect a string. That's what the `` component does: it gives you an output string of its child components and lets you transform it in any way.\n**Note:** `` must be applied only to `` children components and shouldn't change the dimensions of the output; otherwise, the layout will be incorrect.\n```js\nimport {render, Transform} from 'ink';\nconst Example = () => (\n\t output.toUpperCase()}>\n\t\tHello World\n\t\n);\nrender();\n```\nSince the `transform` function converts all characters to uppercase, the final output rendered to the terminal will be \"HELLO WORLD\", not \"Hello World\".\nWhen the output wraps to multiple lines, it can be helpful to know which line is being processed.\nFor example, to implement a hanging indent component, you can indent all the lines except for the first.\n```js\nimport {render, Transform} from 'ink';\nconst HangingIndent = ({content, indent = 4, children, ...props}) => (\n\t\n\t\t\tindex === 0 ? line : ' '.repeat(indent) + line\n\t\t}\n\t\t{...props}\n\t>\n\t\t{children}\n\t\n);\nconst text =\n\t'WHEN I WROTE the following pages, or rather the bulk of them, ' +\n\t'I lived alone, in the woods, a mile from any neighbor, in a ' +\n\t'house which I had built myself, on the shore of Walden Pond, ' +\n\t'in Concord, Massachusetts, and earned my living by the labor ' +\n\t'of my hands only. I lived there two years and two months. At ' +\n\t'present I am a sojourner in civilized life again.';\n// Other text properties are allowed as well\nrender(\n\t\n\t\t{text}\n\t\n);\n```\n#### transform(outputLine, index)\n[](#transformoutputline-index)\nType: `Function`\nFunction that transforms children output. It accepts children and must return transformed children as well.\n##### children\n[](#children)\nType: `string`\nOutput of child components.\n##### index\n[](#index)\nType: `number`\nThe zero-indexed line number of the line that's currently being transformed.\n## Hooks\n[](#hooks)\n### useInput(inputHandler, options?)\n[](#useinputinputhandler-options)\nThis hook is used for handling user input. It's a more convenient alternative to using `useStdin` and listening for `data` events. The callback you pass to `useInput` is called for each character when the user enters any input. However, if the user pastes text and it's more than one character, the callback will be called only once, and the whole string will be passed as `input`. You can find a full example of using `useInput` at [examples/use-input](https://github.com/vadimdemedes/ink/blob/master/examples/use-input/use-input.tsx).\n```js\nimport {useInput} from 'ink';\nconst UserInput = () => {\n\tuseInput((input, key) => {\n\t\tif (input === 'q') {\n\t\t\t// Exit program\n\t\t}\n\t\tif (key.leftArrow) {\n\t\t\t// Left arrow key pressed\n\t\t}\n\t});\n\treturn …\n};\n```\n#### inputHandler(input, key)\n[](#inputhandlerinput-key)\nType: `Function`\nThe handler function that you pass to `useInput` receives two arguments:\n##### input\n[](#input)\nType: `string`\nThe input that the program received.\n##### key\n[](#key)\nType: `object`\nHandy information about a key that was pressed.\n###### key.leftArrow\n[](#keyleftarrow)\n###### key.rightArrow\n[](#keyrightarrow)\n###### key.upArrow\n[](#keyuparrow)\n###### key.downArrow\n[](#keydownarrow)\nType: `boolean`\nDefault: `false`\nIf an arrow key was pressed, the corresponding property will be `true`. For example, if the user presses the left arrow key, `key.leftArrow` equals `true`.\n###### key.return\n[](#keyreturn)\nType: `boolean`\nDefault: `false`\nReturn (Enter) key was pressed.\n###### key.escape\n[](#keyescape)\nType: `boolean`\nDefault: `false`\nEscape key was pressed.\n###### key.ctrl\n[](#keyctrl)\nType: `boolean`\nDefault: `false`\nCtrl key was pressed.\n###### key.shift\n[](#keyshift)\nType: `boolean`\nDefault: `false`\nShift key was pressed.\n###### key.tab\n[](#keytab)\nType: `boolean`\nDefault: `false`\nTab key was pressed.\n###### key.backspace\n[](#keybackspace)\nType: `boolean`\nDefault: `false`\nBackspace key was pressed.\n###### key.delete\n[](#keydelete)\nType: `boolean`\nDefault: `false`\nDelete key was pressed.\n###### key.pageDown\n[](#keypagedown)\n###### key.pageUp\n[](#keypageup)\nType: `boolean`\nDefault: `false`\nIf the Page Up or Page Down key was pressed, the corresponding property will be `true`. For example, if the user presses Page Down, `key.pageDown` equals `true`.\n###### key.meta\n[](#keymeta)\nType: `boolean`\nDefault: `false`\n[Meta key](https://en.wikipedia.org/wiki/Meta_key) was pressed.\n#### options\n[](#options)\nType: `object`\n##### isActive\n[](#isactive)\nType: `boolean`\nDefault: `true`\nEnable or disable capturing of user input. Useful when there are multiple `useInput` hooks used at once to avoid handling the same input several times.\n### useApp()\n[](#useapp)\n`useApp` is a React hook that exposes a method to manually exit the app (unmount).\n#### exit(error?)\n[](#exiterror)\nType: `Function`\nExit (unmount) the whole Ink app.\n##### error\n[](#error)\nType: `Error`\nOptional error. If passed, [`waitUntilExit`](https://github.com/vadimdemedes/ink/blob/master/waituntilexit) will reject with that error.\n```js\nimport {useApp} from 'ink';\nconst Example = () => {\n\tconst {exit} = useApp();\n\t// Exit the app after 5 seconds\n\tuseEffect(() => {\n\t\tsetTimeout(() => {\n\t\t\texit();\n\t\t}, 5000);\n\t}, []);\n\treturn …\n};\n```\n### useStdin()\n[](#usestdin)\n`useStdin` is a React hook that exposes the stdin stream.\n#### stdin\n[](#stdin)\nType: `stream.Readable`\nDefault: `process.stdin`\nThe stdin stream passed to `render()` in `options.stdin`, or `process.stdin` by default. Useful if your app needs to handle user input.\n```js\nimport {useStdin} from 'ink';\nconst Example = () => {\n\tconst {stdin} = useStdin();\n\treturn …\n};\n```\n#### isRawModeSupported\n[](#israwmodesupported)\nType: `boolean`\nA boolean flag determining if the current `stdin` supports `setRawMode`. A component using `setRawMode` might want to use `isRawModeSupported` to nicely fall back in environments where raw mode is not supported.\n```js\nimport {useStdin} from 'ink';\nconst Example = () => {\n\tconst {isRawModeSupported} = useStdin();\n\treturn isRawModeSupported ? (\n\t\t\n\t) : (\n\t\t\n\t);\n};\n```\n#### setRawMode(isRawModeEnabled)\n[](#setrawmodeisrawmodeenabled)\nType: `function`\n##### isRawModeEnabled\n[](#israwmodeenabled)\nType: `boolean`\nSee [`setRawMode`](https://nodejs.org/api/tty.html#tty_readstream_setrawmode_mode). Ink exposes this function to be able to handle Ctrl+C, that's why you should use Ink's `setRawMode` instead of `process.stdin.setRawMode`.\n**Warning:** This function will throw unless the current `stdin` supports `setRawMode`. Use [`isRawModeSupported`](#israwmodesupported) to detect `setRawMode` support.\n```js\nimport {useStdin} from 'ink';\nconst Example = () => {\n\tconst {setRawMode} = useStdin();\n\tuseEffect(() => {\n\t\tsetRawMode(true);\n\t\treturn () => {\n\t\t\tsetRawMode(false);\n\t\t};\n\t});\n\treturn …\n};\n```\n### useStdout()\n[](#usestdout)\n`useStdout` is a React hook that exposes the stdout stream where Ink renders your app.\n#### stdout\n[](#stdout)\nType: `stream.Writable`\nDefault: `process.stdout`\n```js\nimport {useStdout} from 'ink';\nconst Example = () => {\n\tconst {stdout} = useStdout();\n\treturn …\n};\n```\n#### write(data)\n[](#writedata)\nWrite 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 ``, except it can't accept components; it only works with strings.\n##### data\n[](#data)\nType: `string`\nData to write to stdout.\n```js\nimport {useStdout} from 'ink';\nconst Example = () => {\n\tconst {write} = useStdout();\n\tuseEffect(() => {\n\t\t// Write a single message to stdout, above Ink's output\n\t\twrite('Hello from Ink to stdout\\n');\n\t}, []);\n\treturn …\n};\n```\nSee additional usage example in [examples/use-stdout](https://github.com/vadimdemedes/ink/blob/master/examples/use-stdout/use-stdout.tsx).\n### useStderr()\n[](#usestderr)\n`useStderr` is a React hook that exposes the stderr stream.\n#### stderr\n[](#stderr)\nType: `stream.Writable`\nDefault: `process.stderr`\nStderr stream.\n```js\nimport {useStderr} from 'ink';\nconst Example = () => {\n\tconst {stderr} = useStderr();\n\treturn …\n};\n```\n#### write(data)\n[](#writedata-1)\nWrite any string to stderr while preserving Ink's output.\nIt'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 ``, except it can't accept components; it only works with strings.\n##### data\n[](#data-1)\nType: `string`\nData to write to stderr.\n```js\nimport {useStderr} from 'ink';\nconst Example = () => {\n\tconst {write} = useStderr();\n\tuseEffect(() => {\n\t\t// Write a single message to stderr, above Ink's output\n\t\twrite('Hello from Ink to stderr\\n');\n\t}, []);\n\treturn …\n};\n```\n### useFocus(options?)\n[](#usefocusoptions)\nA component that uses the `useFocus` hook becomes \"focusable\" to Ink, so when the user presses Tab, Ink will switch focus to this component. If there are multiple components that execute the `useFocus` hook, focus will be given to them in the order in which these components are rendered. This hook returns an object with an `isFocused` boolean property, which determines whether this component is focused.\n#### options\n[](#options-1)\n##### autoFocus\n[](#autofocus)\nType: `boolean`\nDefault: `false`\nAuto-focus this component if there's no active (focused) component right now.\n##### isActive\n[](#isactive-1)\nType: `boolean`\nDefault: `true`\nEnable or disable this component's focus, while still maintaining its position in the list of focusable components. This is useful for inputs that are temporarily disabled.\n##### id\n[](#id)\nType: `string`\nRequired: `false`\nSet a component's focus ID, which can be used to programmatically focus the component. This is useful for large interfaces with many focusable elements to avoid having to cycle through all of them.\n```js\nimport {render, useFocus, Text} from 'ink';\nconst Example = () => {\n\tconst {isFocused} = useFocus();\n\treturn {isFocused ? 'I am focused' : 'I am not focused'};\n};\nrender();\n```\nSee example in [examples/use-focus](https://github.com/vadimdemedes/ink/blob/master/examples/use-focus/use-focus.tsx) and [examples/use-focus-with-id](https://github.com/vadimdemedes/ink/blob/master/examples/use-focus-with-id/use-focus-with-id.tsx).\n### useFocusManager()\n[](#usefocusmanager)\nThis hook exposes methods to enable or disable focus management for all components or manually switch focus to next or previous components.\n#### enableFocus()\n[](#enablefocus)\nEnable focus management for all components.\n**Note:** You don't need to call this method manually unless you've disabled focus management. Focus management is enabled by default.\n```js\nimport {useFocusManager} from 'ink';\nconst Example = () => {\n\tconst {enableFocus} = useFocusManager();\n\tuseEffect(() => {\n\t\tenableFocus();\n\t}, []);\n\treturn …\n};\n```\n#### disableFocus()\n[](#disablefocus)\nDisable focus management for all components. The currently active component (if there's one) will lose its focus.\n```js\nimport {useFocusManager} from 'ink';\nconst Example = () => {\n\tconst {disableFocus} = useFocusManager();\n\tuseEffect(() => {\n\t\tdisableFocus();\n\t}, []);\n\treturn …\n};\n```\n#### focusNext()\n[](#focusnext)\nSwitch focus to the next focusable component. If there's no active component right now, focus will be given to the first focusable component. If the active component is the last in the list of focusable components, focus will be switched to the first focusable component.\n**Note:** Ink calls this method when user presses Tab.\n```js\nimport {useFocusManager} from 'ink';\nconst Example = () => {\n\tconst {focusNext} = useFocusManager();\n\tuseEffect(() => {\n\t\tfocusNext();\n\t}, []);\n\treturn …\n};\n```\n#### focusPrevious()\n[](#focusprevious)\nSwitch focus to the previous focusable component. If there's no active component right now, focus will be given to the first focusable component. If the active component is the first in the list of focusable components, focus will be switched to the last focusable component.\n**Note:** Ink calls this method when user presses Shift+Tab.\n```js\nimport {useFocusManager} from 'ink';\nconst Example = () => {\n\tconst {focusPrevious} = useFocusManager();\n\tuseEffect(() => {\n\t\tfocusPrevious();\n\t}, []);\n\treturn …\n};\n```\n#### focus(id)\n[](#focusid)\n##### id\n[](#id-1)\nType: `string`\nSwitch focus to the component with the given [`id`](#id). If there's no component with that ID, focus will be given to the next focusable component.\n```js\nimport {useFocusManager, useInput} from 'ink';\nconst Example = () => {\n\tconst {focus} = useFocusManager();\n\tuseInput(input => {\n\t\tif (input === 's') {\n\t\t\t// Focus the component with focus ID 'someId'\n\t\t\tfocus('someId');\n\t\t}\n\t});\n\treturn …\n};\n```\n### useIsScreenReaderEnabled()\n[](#useisscreenreaderenabled)\nReturns whether a screen reader is enabled. This is useful when you want to render different output for screen readers.\n```js\nimport {useIsScreenReaderEnabled, Text} from 'ink';\nconst Example = () => {\n\tconst isScreenReaderEnabled = useIsScreenReaderEnabled();\n\treturn (\n\t\t\n\t\t\t{isScreenReaderEnabled\n\t\t\t\t? 'Screen reader is enabled'\n\t\t\t\t: 'Screen reader is disabled'}\n\t\t\n\t);\n};\n```\n## API\n[](#api)\n#### render(tree, options?)\n[](#rendertree-options)\nReturns: [`Instance`](#instance)\nMount a component and render the output.\n##### tree\n[](#tree)\nType: `ReactElement`\n##### options\n[](#options-2)\nType: `object`\n###### stdout\n[](#stdout-1)\nType: `stream.Writable`\nDefault: `process.stdout`\nOutput stream where app will be rendered.\n###### stdin\n[](#stdin-1)\nType: `stream.Readable`\nDefault: `process.stdin`\nInput stream where app will listen for input.\n###### exitOnCtrlC\n[](#exitonctrlc)\nType: `boolean`\nDefault: `true`\nConfigure whether Ink should listen for Ctrl+C keyboard input and exit the app. This is needed in case `process.stdin` is in [raw mode](https://nodejs.org/api/tty.html#tty_readstream_setrawmode_mode), because then Ctrl+C is ignored by default and the process is expected to handle it manually.\n###### patchConsole\n[](#patchconsole)\nType: `boolean`\nDefault: `true`\nPatch console methods to ensure console output doesn't mix with Ink's output. When any of the `console.*` methods are called (like `console.log()`), Ink intercepts their output, clears the main output, renders output from the console method, and then rerenders the main output again. That way, both are visible and don't overlap each other.\nThis functionality is powered by [patch-console](https://github.com/vadimdemedes/patch-console), so if you need to disable Ink's interception of output but want to build something custom, you can use that.\n###### debug\n[](#debug)\nType: `boolean`\nDefault: `false`\nIf `true`, each update will be rendered as separate output, without replacing the previous one.\n###### maxFps\n[](#maxfps)\nType: `number`\nDefault: `30`\nMaximum frames per second for render updates. This controls how frequently the UI can update to prevent excessive re-rendering. Higher values allow more frequent updates but may impact performance. Setting it to a lower value may be useful for components that update very frequently, to reduce CPU usage.\n#### Instance\n[](#instance)\nThis is the object that `render()` returns.\n##### rerender(tree)\n[](#rerendertree)\nReplace the previous root node with a new one or update props of the current root node.\n###### tree\n[](#tree-1)\nType: `ReactElement`\n```js\n// Update props of the root node\nconst {rerender} = render();\nrerender();\n// Replace root node\nconst {rerender} = render();\nrerender();\n```\n##### unmount()\n[](#unmount)\nManually unmount the whole Ink app.\n```js\nconst {unmount} = render();\nunmount();\n```\n##### waitUntilExit()\n[](#waituntilexit)\nReturns a promise that resolves when the app is unmounted.\n```js\nconst {unmount, waitUntilExit} = render();\nsetTimeout(unmount, 1000);\nawait waitUntilExit(); // resolves after `unmount()` is called\n```\n##### clear()\n[](#clear)\nClear output.\n```js\nconst {clear} = render();\nclear();\n```\n#### measureElement(ref)\n[](#measureelementref)\nMeasure the dimensions of a particular `` element. Returns an object with `width` and `height` properties. This function is useful when your component needs to know the amount of available space it has. You can use it when you need to change the layout based on the length of its content.\n**Note:** `measureElement()` returns correct results only after the initial render, when the layout has been calculated. Until then, `width` and `height` equal zero. It's recommended to call `measureElement()` in a `useEffect` hook, which fires after the component has rendered.\n##### ref\n[](#ref)\nType: `MutableRef`\nA reference to a `` element captured with the `ref` property. See [Refs](https://reactjs.org/docs/refs-and-the-dom.html) for more information on how to capture references.\n```js\nimport {render, measureElement, Box, Text} from 'ink';\nconst Example = () => {\n\tconst ref = useRef();\n\tuseEffect(() => {\n\t\tconst {width, height} = measureElement(ref.current);\n\t\t// width = 100, height = 1\n\t}, []);\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\tThis box will stretch to 100 width\n\t\t\t\n\t\t\n\t);\n};\nrender();\n```\n## Testing\n[](#testing)\nInk components are simple to test with [ink-testing-library](https://github.com/vadimdemedes/ink-testing-library). Here's a simple example that checks how component is rendered:\n```js\nimport React from 'react';\nimport {Text} from 'ink';\nimport {render} from 'ink-testing-library';\nconst Test = () => Hello World;\nconst {lastFrame} = render();\nlastFrame() === 'Hello World'; //=> true\n```\nCheck out [ink-testing-library](https://github.com/vadimdemedes/ink-testing-library) for more examples and full documentation.\n## Using React Devtools\n[](#using-react-devtools)\n[](https://github.com/vadimdemedes/ink/blob/master/media/devtools.jpg)\nInk supports [React Devtools](https://github.com/facebook/react/tree/master/packages/react-devtools) out of the box. To enable integration with React Devtools in your Ink-based CLI, first ensure you have installed the optional `react-devtools-core` dependency, and then run your app with the `DEV=true` environment variable:\n```shell\nDEV=true my-cli\n```\nThen, start React Devtools itself:\n```shell\nnpx react-devtools\n```\nAfter it starts, you should see the component tree of your CLI. You can even inspect and change the props of components, and see the results immediately in the CLI, without restarting it.\n**Note**: You must manually quit your CLI via Ctrl+C after you're done testing.\n## Screen Reader Support\n[](#screen-reader-support)\nInk has basic support for screen readers.\nTo enable it, you can either pass the `isScreenReaderEnabled` option to the `render` function or set the `INK_SCREEN_READER` environment variable to `true`.\nInk implements a small subset of functionality from the [ARIA specification](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA).\n```js\nrender(, {isScreenReaderEnabled: true});\n```\nWhen screen reader support is enabled, Ink will try its best to generate a screen-reader-friendly output.\nFor example, for this code:\n```js\n\n\tAccept terms and conditions\n\n```\nInk will generate the following output for screen readers:\n```\n(checked) checkbox: Accept terms and conditions\n```\nYou can also provide a custom label for screen readers if you want to render something different for them.\nFor example, if you are building a progress bar, you can use `aria-label` to provide a more descriptive label for screen readers.\n```js\n\n\t\n\t50%\n\n```\nIn the example above, the screen reader will read \"Progress: 50%\" instead of \"50%\".\n### `aria-label`\n[](#aria-label)\nType: `string`\nA label for the element for screen readers.\n### `aria-hidden`\n[](#aria-hidden)\nType: `boolean`\nDefault: `false`\nHide the element from screen readers.\n##### aria-role\n[](#aria-role)\nType: `string`\nThe role of the element.\nSupported values:\n- `button`\n- `checkbox`\n- `radio`\n- `radiogroup`\n- `list`\n- `listitem`\n- `menu`\n- `menuitem`\n- `progressbar`\n- `tab`\n- `tablist`\n- `timer`\n- `toolbar`\n- `table`\n##### aria-state\n[](#aria-state)\nType: `object`\nThe state of the element.\nSupported values:\n- `checked` (boolean)\n- `disabled` (boolean)\n- `expanded` (boolean)\n- `selected` (boolean)\n## Creating Components\n[](#creating-components)\nWhen building custom components, it's important to keep accessibility in mind. While Ink provides the building blocks, ensuring your components are accessible will make your CLIs usable by a wider audience.\n### General Principles\n[](#general-principles)\n- **Provide screen reader-friendly output:** Use the `useIsScreenReaderEnabled` hook to detect if a screen reader is active. You can then render more descriptive output for screen reader users.\n- **Leverage ARIA props:** For components that have a specific role (e.g., a checkbox or button), use the `aria-role`, `aria-state`, and `aria-label` props on `` and `` to provide semantic meaning to screen readers.\nFor a practical example of building an accessible component, see the [ARIA example](https://github.com/vadimdemedes/ink/blob/master/examples/aria/aria.tsx).\n## Useful Components\n[](#useful-components)\n- [ink-text-input](https://github.com/vadimdemedes/ink-text-input) - Text input.\n- [ink-spinner](https://github.com/vadimdemedes/ink-spinner) - Spinner.\n- [ink-select-input](https://github.com/vadimdemedes/ink-select-input) - Select (dropdown) input.\n- [ink-link](https://github.com/sindresorhus/ink-link) - Link.\n- [ink-gradient](https://github.com/sindresorhus/ink-gradient) - Gradient color.\n- [ink-big-text](https://github.com/sindresorhus/ink-big-text) - Awesome text.\n- [ink-picture](https://github.com/endernoke/ink-picture) - Display images.\n- [ink-tab](https://github.com/jdeniau/ink-tab) - Tab.\n- [ink-color-pipe](https://github.com/LitoMore/ink-color-pipe) - Create color text with simpler style strings.\n- [ink-multi-select](https://github.com/karaggeorge/ink-multi-select) - Select one or more values from a list\n- [ink-divider](https://github.com/JureSotosek/ink-divider) - A divider.\n- [ink-progress-bar](https://github.com/brigand/ink-progress-bar) - Progress bar.\n- [ink-table](https://github.com/maticzav/ink-table) - Table.\n- [ink-ascii](https://github.com/hexrcs/ink-ascii) - Awesome text component with more font choices, based on Figlet.\n- [ink-markdown](https://github.com/cameronhunter/ink-markdown) - Render syntax highlighted Markdown.\n- [ink-quicksearch-input](https://github.com/Eximchain/ink-quicksearch-input) - Select component with fast, quicksearch-like navigation.\n- [ink-confirm-input](https://github.com/kevva/ink-confirm-input) - Yes/No confirmation input.\n- [ink-syntax-highlight](https://github.com/vsashyn/ink-syntax-highlight) - Code syntax highlighting.\n- [ink-form](https://github.com/lukasbach/ink-form) - Form.\n- [ink-task-list](https://github.com/privatenumber/ink-task-list) - Task list.\n- [ink-spawn](https://github.com/kraenhansen/ink-spawn) - Spawn child processes.\n- [ink-titled-box](https://github.com/mishieck/ink-titled-box) - Box with a title.\n- [ink-chart](https://github.com/pppp606/ink-chart) - Sparkline and bar chart.\n## Useful Hooks\n[](#useful-hooks)\n- [ink-use-stdout-dimensions](https://github.com/cameronhunter/ink-monorepo/tree/master/packages/ink-use-stdout-dimensions) - Subscribe to stdout dimensions.\n## Examples\n[](#examples)\nThe [`examples`](https://github.com/vadimdemedes/ink/blob/master/examples) directory contains a set of real examples. You can run them with:\n```shell\nnpm run example examples/[example name]\n# e.g. npm run example examples/borders\n```\n- [Jest](https://github.com/vadimdemedes/ink/blob/master/examples/jest/jest.tsx) - Implementation of basic Jest UI.\n- [Counter](https://github.com/vadimdemedes/ink/blob/master/examples/counter/counter.tsx) - A simple counter that increments every 100ms.\n- [Form with validation](https://github.com/final-form/rff-cli-example) - Manage form state using [Final Form](https://github.com/final-form/final-form#-final-form).\n- [Borders](https://github.com/vadimdemedes/ink/blob/master/examples/borders/borders.tsx) - Add borders to the `` component.\n- [Suspense](https://github.com/vadimdemedes/ink/blob/master/examples/suspense/suspense.tsx) - Use React Suspense.\n- [Table](https://github.com/vadimdemedes/ink/blob/master/examples/table/table.tsx) - Renders a table with multiple columns and rows.\n- [Focus management](https://github.com/vadimdemedes/ink/blob/master/examples/use-focus/use-focus.tsx) - Use the `useFocus` hook to manage focus between components.\n- [User input](https://github.com/vadimdemedes/ink/blob/master/examples/use-input/use-input.tsx) - Listen for user input.\n- [Write to stdout](https://github.com/vadimdemedes/ink/blob/master/examples/use-stdout/use-stdout.tsx) - Write to stdout, bypassing main Ink output.\n- [Write to stderr](https://github.com/vadimdemedes/ink/blob/master/examples/use-stderr/use-stderr.tsx) - Write to stderr, bypassing main Ink output.\n- [Static](https://github.com/vadimdemedes/ink/blob/master/examples/static/static.tsx) - Use the `` component to render permanent output.\n- [Child process](https://github.com/vadimdemedes/ink/blob/master/examples/subprocess-output) - Renders output from a child process.\n## Maintainers\n[](#maintainers)\n- [Vadim Demedes](https://github.com/vadimdemedes)\n- [Sindre Sorhus](https://github.com/sindresorhus)\n## About\n🌈 React for interactive command-line apps\n[term.ink](https://term.ink \"https://term.ink\")\n### Topics\n[react](https://github.com/topics/react \"Topic: react\") [javascript](https://github.com/topics/javascript \"Topic: javascript\") [cli](https://github.com/topics/cli \"Topic: cli\") [command-line](https://github.com/topics/command-line \"Topic: command-line\") [interactive](https://github.com/topics/interactive \"Topic: interactive\") [flexbox](https://github.com/topics/flexbox \"Topic: flexbox\")\n### Resources\n[Readme](#readme-ov-file)\n### License\n[MIT license](#MIT-1-ov-file)\n### Code of conduct\n[Code of conduct](#coc-ov-file)\n### Contributing\n[Contributing](#contributing-ov-file)\n### Uh oh!\nThere was an error while loading. Please reload this page.\n[Activity](https://github.com/vadimdemedes/ink/activity)\n### Stars\n[**32k** stars](https://github.com/vadimdemedes/ink/stargazers)\n### Watchers\n[**112** watching](https://github.com/vadimdemedes/ink/watchers)\n### Forks\n[**749** forks](https://github.com/vadimdemedes/ink/forks)\n[Report repository](https://github.com/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2Fvadimdemedes%2Fink&report=vadimdemedes+%28user%29)\n## [Releases 66](https://github.com/vadimdemedes/ink/releases)\n[\nv6.3.1 Latest\nSep 19, 2025\n](https://github.com/vadimdemedes/ink/releases/tag/v6.3.1)\n[\\+ 65 releases](https://github.com/vadimdemedes/ink/releases)\n## Sponsor this project\n### Uh oh!\nThere was an error while loading. Please reload this page.\n- [opencollective.com/**vadimdemedes**](https://opencollective.com/vadimdemedes)\n- [https://www.comebackalive.in.ua](https://www.comebackalive.in.ua)\n## [Used by 91k](https://github.com/vadimdemedes/ink/network/dependents)\n[\n- \n- \n- \n- \n- \n- \n- \n- \n\\+ 90,950](https://github.com/vadimdemedes/ink/network/dependents)\n## [Contributors 140](https://github.com/vadimdemedes/ink/graphs/contributors)\n- [](https://github.com/sindresorhus)\n- [](https://github.com/vadimdemedes)\n- [](https://github.com/LitoMore)\n- [](https://github.com/karaggeorge)\n- [](https://github.com/matteodepalo)\n- [](https://github.com/chrstnb)\n- [](https://github.com/noritaka1166)\n- [](https://github.com/SimenB)\n- [](https://github.com/isaacs)\n- [](https://github.com/cameronhunter)\n- [](https://github.com/eweilow)\n- [](https://github.com/privatenumber)\n- [](https://github.com/ForbesLindesay)\n- [](https://github.com/jdeniau)\n[\\+ 126 contributors](https://github.com/vadimdemedes/ink/graphs/contributors)\n## Languages\n- [TypeScript 99.6%](https://github.com/vadimdemedes/ink/search?l=typescript)\n- [JavaScript 0.4%](https://github.com/vadimdemedes/ink/search?l=javascript)\n## Footer\n[](https://github.com)© 2025 GitHub, Inc.\n### Footer navigation\n- [Terms](https://docs.github.com/site-policy/github-terms/github-terms-of-service)\n- [Privacy](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement)\n- [Security](https://github.com/security)\n- [Status](https://www.githubstatus.com/)\n- [Community](https://github.community/)\n- [Docs](https://docs.github.com/)\n- [Contact](https://support.github.com?tags=dotcom-footer)\n- Manage cookies\n- Do not share my personal information\nYou can’t perform that action at this time.",
- "timestamp": 1760033163862,
- "title": "GitHub - vadimdemedes/ink: 🌈 React for interactive command-line apps"
-}
\ No newline at end of file
diff --git a/.cache/c99eae7ec8a4e2cd96d38f90161460a75509d2dbabdc1c4f34803d984dc91dfd.json b/.cache/c99eae7ec8a4e2cd96d38f90161460a75509d2dbabdc1c4f34803d984dc91dfd.json
deleted file mode 100644
index 5ed23a3..0000000
--- a/.cache/c99eae7ec8a4e2cd96d38f90161460a75509d2dbabdc1c4f34803d984dc91dfd.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "url": "https://github.com/vadimdemedes/ink/issues/153",
- "markdown": "# Respond and reflow with terminal resize events · Issue #153 · vadimdemedes/ink · GitHub\n*By\n vadimdemedes\n*\n---\n[Skip to content](#start-of-content)\n## Navigation Menu\nToggle navigation\n[](https://github.com/)\n[Sign in](https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvadimdemedes%2Fink%2Fissues%2F153)\nAppearance settings\n- Platform\n - [\n GitHub Copilot\n Write better code with AI\n ](https://github.com/features/copilot)\n - [\n GitHub Spark New\n Build and deploy intelligent apps\n ](https://github.com/features/spark)\n - [\n GitHub Models New\n Manage and compare prompts\n ](https://github.com/features/models)\n - [\n GitHub Advanced Security\n Find and fix vulnerabilities\n ](https://github.com/security/advanced-security)\n - [\n Actions\n Automate any workflow\n ](https://github.com/features/actions)\n - [\n Codespaces\n Instant dev environments\n ](https://github.com/features/codespaces)\n - [\n Issues\n Plan and track work\n ](https://github.com/features/issues)\n - [\n Code Review\n Manage code changes\n ](https://github.com/features/code-review)\n - [\n Discussions\n Collaborate outside of code\n ](https://github.com/features/discussions)\n - [\n Code Search\n Find more, search less\n ](https://github.com/features/code-search)\n Explore\n - [Why GitHub](https://github.com/why-github)\n - [Documentation](https://docs.github.com)\n - [GitHub Skills](https://skills.github.com)\n - [Blog](https://github.blog)\n Integrations\n - [GitHub Marketplace](https://github.com/marketplace)\n - [MCP Registry](https://github.com/mcp)\n [View all features](https://github.com/features)\n- Solutions\n By company size\n - [Enterprises](https://github.com/enterprise)\n - [Small and medium teams](https://github.com/team)\n - [Startups](https://github.com/enterprise/startups)\n - [Nonprofits](https://github.com/solutions/industry/nonprofits)\n By use case\n - [App Modernization](https://github.com/solutions/use-case/app-modernization)\n - [DevSecOps](https://github.com/solutions/use-case/devsecops)\n - [DevOps](https://github.com/solutions/use-case/devops)\n - [CI/CD](https://github.com/solutions/use-case/ci-cd)\n - [View all use cases](https://github.com/solutions/use-case)\n By industry\n - [Healthcare](https://github.com/solutions/industry/healthcare)\n - [Financial services](https://github.com/solutions/industry/financial-services)\n - [Manufacturing](https://github.com/solutions/industry/manufacturing)\n - [Government](https://github.com/solutions/industry/government)\n - [View all industries](https://github.com/solutions/industry)\n [View all solutions](https://github.com/solutions)\n- Resources\n Topics\n - [AI](https://github.com/resources/articles/ai)\n - [DevOps](https://github.com/resources/articles/devops)\n - [Security](https://github.com/resources/articles/security)\n - [Software Development](https://github.com/resources/articles/software-development)\n - [View all](https://github.com/resources/articles)\n Explore\n - [Learning Pathways](https://resources.github.com/learn/pathways)\n - [Events & Webinars](https://github.com/resources/events)\n - [Ebooks & Whitepapers](https://github.com/resources/whitepapers)\n - [Customer Stories](https://github.com/customer-stories)\n - [Partners](https://github.com/partners)\n - [Executive Insights](https://github.com/solutions/executive-insights)\n- Open Source\n - [\n GitHub Sponsors\n Fund open source developers\n ](https://github.com/sponsors)\n - [\n The ReadME Project\n GitHub community articles\n ](https://github.com/readme)\n Repositories\n - [Topics](https://github.com/topics)\n - [Trending](https://github.com/trending)\n - [Collections](https://github.com/collections)\n- Enterprise\n - [\n Enterprise platform\n AI-powered developer platform\n ](https://github.com/enterprise)\n Available add-ons\n - [\n GitHub Advanced Security\n Enterprise-grade security features\n ](https://github.com/security/advanced-security)\n - [\n Copilot for business\n Enterprise-grade AI features\n ](https://github.com/features/copilot/copilot-business)\n - [\n Premium Support\n Enterprise-grade 24/7 support\n ](https://github.com/premium-support)\n- [Pricing](https://github.com/pricing)\nSearch or jump to...\n# Search code, repositories, users, issues, pull requests...\nSearch\nClear\n[Search syntax tips](https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax)\n# Provide feedback\nWe read every piece of feedback, and take your input very seriously.\n Include my email address so I can be contacted\nCancel Submit feedback\n# Saved searches\n## Use saved searches to filter your results more quickly\nName\nQuery\nTo see all available qualifiers, see our [documentation](https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax).\nCancel Create saved search\n[Sign in](https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvadimdemedes%2Fink%2Fissues%2F153)\n[Sign up](https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=vadimdemedes%2Fink)\nAppearance settings\nResetting focus\nYou signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert\n[vadimdemedes](https://github.com/vadimdemedes) / **[ink](https://github.com/vadimdemedes/ink)** Public\n- ### Uh oh!\n There was an error while loading. Please reload this page.\n- [Notifications](https://github.com/login?return_to=%2Fvadimdemedes%2Fink) You must be signed in to change notification settings\n- [Fork 749](https://github.com/login?return_to=%2Fvadimdemedes%2Fink)\n- [Star 32k](https://github.com/login?return_to=%2Fvadimdemedes%2Fink)\n- [Code](https://github.com/vadimdemedes/ink)\n- [Issues 78](https://github.com/vadimdemedes/ink/issues)\n- [Pull requests 15](https://github.com/vadimdemedes/ink/pulls)\n- [Discussions](https://github.com/vadimdemedes/ink/discussions)\n- [Actions](https://github.com/vadimdemedes/ink/actions)\n- [Projects 0](https://github.com/vadimdemedes/ink/projects)\n- [Security](https://github.com/vadimdemedes/ink/security)\n [](https://github.com/vadimdemedes/ink/security)\n [](https://github.com/vadimdemedes/ink/security)\n [](https://github.com/vadimdemedes/ink/security)\n [\n ### Uh oh!\n ](https://github.com/vadimdemedes/ink/security)\n [There was an error while loading.](https://github.com/vadimdemedes/ink/security) Please reload this page.\n- [Insights](https://github.com/vadimdemedes/ink/pulse)\nAdditional navigation options\n- [Code](https://github.com/vadimdemedes/ink)\n- [Issues](https://github.com/vadimdemedes/ink/issues)\n- [Pull requests](https://github.com/vadimdemedes/ink/pulls)\n- [Discussions](https://github.com/vadimdemedes/ink/discussions)\n- [Actions](https://github.com/vadimdemedes/ink/actions)\n- [Projects](https://github.com/vadimdemedes/ink/projects)\n- [Security](https://github.com/vadimdemedes/ink/security)\n- [Insights](https://github.com/vadimdemedes/ink/pulse)\n# Respond and reflow with terminal resize events #153\n[New issue](https://github.com/login?return_to=)\nCopy link\n[New issue](https://github.com/login?return_to=)\nCopy link\nClosed\n[#304](https://github.com/vadimdemedes/ink/pull/304)\nClosed\n[Respond and reflow with terminal resize events](#top)#153\n[#304](https://github.com/vadimdemedes/ink/pull/304)\nCopy link\nLabels\n[enhancement](https://github.com/vadimdemedes/ink/issues?q=state%3Aopen%20label%3A%22enhancement%22)[shipped in v3](https://github.com/vadimdemedes/ink/issues?q=state%3Aopen%20label%3A%22shipped%20in%20v3%22)\n[](https://github.com/duncanbeevers)\n## Description\n[](https://github.com/duncanbeevers)\n[duncanbeevers](https://github.com/duncanbeevers)\nopened [on Mar 12, 2019](https://github.com/vadimdemedes/ink/issues/153#issue-419800602)\nIssue body actions\nListening to `stdout.on('resize')` is pretty straight-forward, but it looks like the ink renderer is instantiated at a [fixed terminalWidth](https://github.com/vadimdemedes/ink/blob/1aaabc62c819d7f06f1dc12573f008adcd43f92f/src/renderer.js#L25).\nIs it feasible to reconfigure the renderer or to create a new renderer in response to terminal size changes?\n👍React with 👍4ribelo, sindresorhus, maticzav and apeckham\n## Metadata\n## Metadata\n### Assignees\nNo one assigned\n### Labels\n[enhancement](https://github.com/vadimdemedes/ink/issues?q=state%3Aopen%20label%3A%22enhancement%22)[shipped in v3](https://github.com/vadimdemedes/ink/issues?q=state%3Aopen%20label%3A%22shipped%20in%20v3%22)\n### Projects\nNo projects\n### Milestone\nNo milestone\n### Relationships\nNone yet\n### Development\nNo branches or pull requests\n## Issue actions\n## Footer\n[](https://github.com)© 2025 GitHub, Inc.\n### Footer navigation\n- [Terms](https://docs.github.com/site-policy/github-terms/github-terms-of-service)\n- [Privacy](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement)\n- [Security](https://github.com/security)\n- [Status](https://www.githubstatus.com/)\n- [Community](https://github.community/)\n- [Docs](https://docs.github.com/)\n- [Contact](https://support.github.com?tags=dotcom-footer)\n- Manage cookies\n- Do not share my personal information\nYou can’t perform that action at this time.",
- "timestamp": 1760033156208,
- "title": "Respond and reflow with terminal resize events · Issue #153 · vadimdemedes/ink · GitHub"
-}
\ No newline at end of file