{"id":15024840,"url":"https://github.com/syropian/vue-input-autowidth","last_synced_at":"2025-04-06T18:16:49.191Z","repository":{"id":24288134,"uuid":"101085060","full_name":"syropian/vue-input-autowidth","owner":"syropian","description":"A Vue.js directive that automatically resizes an input's width to fit its contents.","archived":false,"fork":false,"pushed_at":"2023-05-24T12:29:32.000Z","size":1907,"stargazers_count":103,"open_issues_count":17,"forks_count":18,"subscribers_count":3,"default_branch":"v2","last_synced_at":"2025-03-30T16:12:58.553Z","etag":null,"topics":["auto-width","input","vue","vue2","vue3"],"latest_commit_sha":null,"homepage":"","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/syropian.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}},"created_at":"2017-08-22T16:38:35.000Z","updated_at":"2025-03-12T09:58:11.000Z","dependencies_parsed_at":"2024-06-18T15:26:28.627Z","dependency_job_id":null,"html_url":"https://github.com/syropian/vue-input-autowidth","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syropian%2Fvue-input-autowidth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syropian%2Fvue-input-autowidth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syropian%2Fvue-input-autowidth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syropian%2Fvue-input-autowidth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syropian","download_url":"https://codeload.github.com/syropian/vue-input-autowidth/tar.gz/refs/heads/v2","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247526767,"owners_count":20953143,"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":["auto-width","input","vue","vue2","vue3"],"created_at":"2024-09-24T20:01:03.005Z","updated_at":"2025-04-06T18:16:49.168Z","avatar_url":"https://github.com/syropian.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# vue-input-autowidth ![tests](https://github.com/syropian/vue-input-autowidth/workflows/tests/badge.svg?branch=v2)\n\nA Vue.js directive that automatically resizes an input's width to fit its contents.\n\n\u003e 🚦 Looking for Vue 2 support? Check out the [master branch](https://github.com/syropian/vue-input-autowidth).\n\n#### [See demo](https://vue-input-autowidth.netlify.app/)\n\n## Installation\n\n```bash\nnpm install vue-input-autowidth@next --save\n# or...\nyarn add vue-input-autowidth@next\n```\n\n_or_\n\nUse the UMD build from [Unpkg](https://unpkg.com/vue-input-autowidth), available as `VueInputAutowidth` in the global scope.\n\n```html\n\u003cscript src=\"/vendor/vue.js\" /\u003e\n\u003cscript src=\"https://unpkg.com/vue-input-autowidth@next\" /\u003e\n```\n\n## Usage\n\n### Globally\n\nImport and register the directive in your app's entrypoint.\n\n```js\nimport { createApp } from 'vue'\nimport App from './App.vue'\nimport { plugin as VueInputAutowidth } from 'vue-input-autowidth'\n\ncreateApp(App).use(VueInputAutowidth).mount('#app')\n```\n\n### Per-component\n\n```js\n\u003cscript\u003e\nimport { directive as VueInputAutowidth } from \"vue-input-autowidth\"\n\nexport default {\n  directives: { autowidth: VueInputAutowidth },\n  setup() {\n    ...\n  },\n}\n\u003c/script\u003e\n```\n\n...and in your template:\n\n```html\n\u003ctemplate\u003e\n  \u003cinput type=\"text\" placeholder=\"First Name\" v-model=\"msg\" v-autowidth /\u003e\n\u003c/template\u003e\n```\n\nYou can also pass some options:\n\n```html\n\u003ctemplate\u003e\n  \u003cinput\n    type=\"text\"\n    placeholder=\"First Name\"\n    v-model=\"msg\"\n    v-autowidth=\"{\n      minWidth: '75px',\n      maxWidth: '75%',\n      comfortZone: '1ch',\n    }\"\n  /\u003e\n\u003c/template\u003e\n```\n\n## Available Options\n\n| Name                                | Type      | Default Value | Description                                                                                                             |\n| ----------------------------------- | --------- | ------------- | ----------------------------------------------------------------------------------------------------------------------- |\n| **maxWidth**                        | `string`  | `undefined`   | Sets the `max-width` CSS property on the element. The value should be a valid CSS size and unit.                        |\n| **minWidth**                        | `string`  | `undefined`   | Sets the `min-width` CSS property on the element. The value should be a valid CSS size and unit.                        |\n| **comfortZone**                     | `string`  | `0px`         | Uses CSS `calc()` to add the specificied amount to the calculated width. The value should be a valid CSS size and unit. |\n| **watchWindowSize**                 | `boolean` | `false`       | When enabled, the directive will listen to the window resize event, and resize the input if needed.                     |\n| **windowResizeHandlerDebounceTime** | `number`  | `150`         | The debounce time in milliseconds for the window resize event. Only applies if `watchWindowSize` is `true`.             |\n| **disableNonInputWarning**          | `boolean` | `false`       | Disables the console warning if you try and use the directive on a non-input element.                                   |\n\n## License\n\nMIT © [Collin Henderson](https://github.com/syropian)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyropian%2Fvue-input-autowidth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyropian%2Fvue-input-autowidth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyropian%2Fvue-input-autowidth/lists"}