{"id":13479522,"url":"https://github.com/vadimdemedes/ink-text-input","last_synced_at":"2025-05-16T08:06:07.766Z","repository":{"id":45180296,"uuid":"96702477","full_name":"vadimdemedes/ink-text-input","owner":"vadimdemedes","description":"Text input component for Ink","archived":false,"fork":false,"pushed_at":"2024-07-03T14:53:59.000Z","size":220,"stargazers_count":151,"open_issues_count":18,"forks_count":40,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-15T09:41:31.166Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vadimdemedes.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"vadimdemedes","custom":"https://www.comebackalive.in.ua"}},"created_at":"2017-07-09T18:14:19.000Z","updated_at":"2025-05-12T18:40:26.000Z","dependencies_parsed_at":"2023-09-24T10:50:09.388Z","dependency_job_id":"4d58b993-1764-4cc5-9f72-9e97af058fae","html_url":"https://github.com/vadimdemedes/ink-text-input","commit_stats":{"total_commits":73,"total_committers":16,"mean_commits":4.5625,"dds":0.4383561643835616,"last_synced_commit":"4ac429ca11da17c2321f7dec1076e38c06d738d5"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vadimdemedes%2Fink-text-input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vadimdemedes%2Fink-text-input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vadimdemedes%2Fink-text-input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vadimdemedes%2Fink-text-input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vadimdemedes","download_url":"https://codeload.github.com/vadimdemedes/ink-text-input/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254493378,"owners_count":22080126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T16:02:18.304Z","updated_at":"2025-05-16T08:06:07.710Z","avatar_url":"https://github.com/vadimdemedes.png","language":"TypeScript","funding_links":["https://opencollective.com/vadimdemedes","https://www.comebackalive.in.ua"],"categories":["TypeScript"],"sub_categories":[],"readme":"# ink-text-input ![test](https://github.com/vadimdemedes/ink-text-input/workflows/test/badge.svg)\n\n\u003e Text input component for [Ink](https://github.com/vadimdemedes/ink).\n\n## Install\n\n```sh\nnpm install ink-text-input\n```\n\n## Usage\n\n```jsx\nimport React, {useState} from 'react';\nimport {render, Box, Text} from 'ink';\nimport TextInput from 'ink-text-input';\n\nconst SearchQuery = () =\u003e {\n\tconst [query, setQuery] = useState('');\n\n\treturn (\n\t\t\u003cBox\u003e\n\t\t\t\u003cBox marginRight={1}\u003e\n\t\t\t\t\u003cText\u003eEnter your query:\u003c/Text\u003e\n\t\t\t\u003c/Box\u003e\n\n\t\t\t\u003cTextInput value={query} onChange={setQuery} /\u003e\n\t\t\u003c/Box\u003e\n\t);\n};\n\nrender(\u003cSearchQuery /\u003e);\n```\n\n\u003cimg src=\"media/demo.gif\" width=\"556\"\u003e\n\n## Props\n\n### value\n\nType: `string`\n\nValue to display in a text input.\n\n### placeholder\n\nType: `string`\n\nText to display when `value` is empty.\n\n### focus\n\nType: `boolean` \\\nDefault: `true`\n\nListen to user's input. Useful in case there are multiple input components at the same time and input must be \"routed\" to a specific component.\n\n### showCursor\n\nType: `boolean`\\\nDefault: `true`\n\nWhether to show cursor and allow navigation inside text input with arrow keys.\n\n### highlightPastedText\n\nType: `boolean`\\\nDefault: `false`\n\nHighlight pasted text.\n\n### mask\n\nType: `string`\n\nReplace all chars and mask the value. Useful for password inputs.\n\n```jsx\n\u003cTextInput value=\"Hello\" mask=\"*\" /\u003e\n//=\u003e \"*****\"\n```\n\n### onChange\n\nType: `Function`\n\nFunction to call when value updates.\n\n### onSubmit\n\nType: `Function`\n\nFunction to call when `Enter` is pressed, where first argument is a value of the input.\n\n## Uncontrolled usage\n\nThis component also exposes an [uncontrolled](https://reactjs.org/docs/uncontrolled-components.html) version, which handles `value` changes for you. To receive the final input value, use `onSubmit` prop.\nInitial value can be specified via `initialValue` prop, which is supported only in `UncontrolledTextInput` component.\n\n```jsx\nimport React from 'react';\nimport {render, Box, Text} from 'ink';\nimport {UncontrolledTextInput} from 'ink-text-input';\n\nconst SearchQuery = () =\u003e {\n\tconst handleSubmit = query =\u003e {\n\t\t// Do something with query\n\t};\n\n\treturn (\n\t\t\u003cBox\u003e\n\t\t\t\u003cBox marginRight={1}\u003e\n\t\t\t\t\u003cText\u003eEnter your query:\u003c/Text\u003e\n\t\t\t\u003c/Box\u003e\n\n\t\t\t\u003cUncontrolledTextInput onSubmit={handleSubmit} /\u003e\n\t\t\u003c/Box\u003e\n\t);\n};\n\nrender(\u003cSearchQuery /\u003e);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvadimdemedes%2Fink-text-input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvadimdemedes%2Fink-text-input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvadimdemedes%2Fink-text-input/lists"}