{"id":19485725,"url":"https://github.com/devforth/vue-suggestion-input","last_synced_at":"2025-11-18T14:32:39.826Z","repository":{"id":251013418,"uuid":"836140035","full_name":"devforth/vue-suggestion-input","owner":"devforth","description":"Text input with Tab-to-complete suggestions in a Github Copilot style (dimmed out text).","archived":false,"fork":false,"pushed_at":"2024-08-15T09:47:25.000Z","size":170,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T12:05:20.693Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Vue","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/devforth.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","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}},"created_at":"2024-07-31T08:28:04.000Z","updated_at":"2024-08-24T16:30:52.000Z","dependencies_parsed_at":"2024-08-15T11:26:09.968Z","dependency_job_id":null,"html_url":"https://github.com/devforth/vue-suggestion-input","commit_stats":null,"previous_names":["devforth/vue-suggestion-input"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devforth%2Fvue-suggestion-input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devforth%2Fvue-suggestion-input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devforth%2Fvue-suggestion-input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devforth%2Fvue-suggestion-input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devforth","download_url":"https://codeload.github.com/devforth/vue-suggestion-input/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240722652,"owners_count":19847146,"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-11-10T20:29:50.298Z","updated_at":"2025-11-18T14:32:39.409Z","avatar_url":"https://github.com/devforth.png","language":"Vue","readme":"# Vue suggestion input\n\nText input with Tab-to-complete suggestions in a Github Copilot style (dimmed out text).\n\n* **Tab** to complete full suggestion\n* **Ctrl + Right** to complete word (up to next space)\n* **Ctrl + Down** to re-init completion\n\n![vue-suggestion-input preview](./image.png)\n\nPlugin in action (with Tailwind CSS and [Chat-GPT API](https://adminforth.dev/docs/tutorial/Advanced/plugin-development/)):\n![vue-suggestion-input demo](https://adminforth.dev/assets/images/demoChatGpt-cb045146add2758d6fb571efef680e80.gif)\n\nExample:\n\n```html\n\n  \u003cSuggestionInput \n    class=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 \n      focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400\n      dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 whitespace-normal\"\n      v-model=\"currentValue\"\n      type=\"string\"\n      :completionRequest=\"complete\"\n      :debounceTime=\"300\"\n    /\u003e\n\n```\n\n* Classes in example above defined by tailwind CSS framework.\n\nScript:\n\n```javascript\nimport SuggestionInput from 'vue-suggestion-input'\nimport 'vue-suggestion-input/dist/style.css';\n\nconst currentValue = ref('');\n\nasync function complete(textBeforeCursor: string): Promise\u003cstring[]\u003e {\n  console.log('✋ complete request', textBeforeCursor);\n\n  // simulate delay\n  await new Promise((resolve) =\u003e setTimeout(resolve, 400));\n\n  // generate N random words of M length\n  const numOfWords = Math.floor(Math.random() * 7) + 1;\n  const words = Array.from({ length: numOfWords }, () =\u003e Math.random().toString(36).substring(2, 15));\n\n  // if textBeforeCursor has \"br\" in end - insert \\n in random word at random place\n  if (textBeforeCursor.endsWith('br')) {\n    const randomWordIndex = Math.floor(Math.random() * words.length);\n    const pos = Math.floor(Math.random() * words[randomWordIndex].length);\n    words[randomWordIndex] = words[randomWordIndex].substring(0, pos) + '\\n' + words[randomWordIndex].substring(pos);\n  }\n\n  return words.map((word) =\u003e `${word} `);\n}\n\n```\n\n\n## Props\n\n### debounceTime\n\nNumber of milliseconds to wait before calling completionRequest after user input.\n\n### completionRequest\n\nAsync function that returns a string to be used as completion. You can use current v-model-bound value to generate suggestions.\n\n### type\n\n'string' or 'text'\n\nString type does not allow user to enter new lines. Text does.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevforth%2Fvue-suggestion-input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevforth%2Fvue-suggestion-input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevforth%2Fvue-suggestion-input/lists"}