{"id":13679241,"url":"https://github.com/Groszczu/use-auto-focus-inputs","last_synced_at":"2025-04-29T18:31:55.038Z","repository":{"id":43410645,"uuid":"392986776","full_name":"Groszczu/use-auto-focus-inputs","owner":"Groszczu","description":"Single react-native hook to manage auto focus of TextInput","archived":false,"fork":false,"pushed_at":"2022-11-30T02:26:38.000Z","size":4525,"stargazers_count":40,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-30T01:39:50.463Z","etag":null,"topics":["auto-focus","hooks","react-native","textinput"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/use-auto-focus-inputs","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/Groszczu.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}},"created_at":"2021-08-05T09:41:51.000Z","updated_at":"2024-03-04T09:48:24.000Z","dependencies_parsed_at":"2023-01-23T00:31:23.576Z","dependency_job_id":null,"html_url":"https://github.com/Groszczu/use-auto-focus-inputs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Groszczu%2Fuse-auto-focus-inputs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Groszczu%2Fuse-auto-focus-inputs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Groszczu%2Fuse-auto-focus-inputs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Groszczu%2Fuse-auto-focus-inputs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Groszczu","download_url":"https://codeload.github.com/Groszczu/use-auto-focus-inputs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224185527,"owners_count":17270066,"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-focus","hooks","react-native","textinput"],"created_at":"2024-08-02T13:01:03.481Z","updated_at":"2024-11-11T22:30:24.248Z","avatar_url":"https://github.com/Groszczu.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# use-auto-focus-inputs\n\nSingle react-native hook to manage auto focus of text inputs\n\n[![GitHub stars](https://img.shields.io/github/stars/Groszczu/use-auto-focus-inputs?style=social)](https://github.com/Groszczu/use-auto-focus-inputs/)\n[![GitHub CI](https://github.com/Groszczu/use-auto-focus-inputs/actions/workflows/release.yml/badge.svg)](https://github.com/Groszczu/use-auto-focus-inputs/actions?query=workflow%3A%22release%22)\n![Version](https://img.shields.io/github/package-json/v/Groszczu/use-auto-focus-inputs)\n[![Minizipped size](https://img.shields.io/bundlephobia/minzip/use-auto-focus-inputs)](https://bundlephobia.com/package/use-auto-focus-inputs@0.1.4)\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](https://github.com/Groszczu/use-auto-focus-inputs/issues)\n\n## Features\n\n- One, headless hook\n- Written with Typescipt\n- Integration with UI libraries\n- No extra dependencies\n\n## Install\n\n    npm install use-auto-focus-inputs\n\n## Quickstart\n\n```jsx\nimport * as React from 'react';\nimport {TextInput, View} from 'react-native';\nimport useAutoFocusInputs from 'use-auto-focus-inputs';\n\nfunction App() {\n  const [firstName, setFirstName] = React.useState('');\n  const [lastName, setLastName] = React.useState('');\n  const [email, setEmail] = React.useState('');\n\n  const getAutoFocusableInputProps = useAutoFocusInputs();\n\n  return (\n    \u003cView style={{flex: 1}}\u003e\n      \u003cTextInput\n        {...getAutoFocusableInputProps({\n          placeholder: 'first name',\n          value: firstName,\n          onChangeText: setFirstName,\n          style: {width: '100%'},\n        })}\n      /\u003e\n      \u003cTextInput\n        {...getAutoFocusableInputProps({\n          placeholder: 'last name',\n          value: lastName,\n          onChangeText: setLastName,\n          style: {width: '100%'},\n        })}\n      /\u003e\n      \u003cTextInput\n        {...getAutoFocusableInputProps({\n          placeholder: 'email',\n          value: email,\n          onChangeText: setEmail,\n          style: {width: '100%'},\n        })}\n      /\u003e\n    \u003c/View\u003e\n  );\n}\n```\n\n## Demo\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/Groszczu/use-auto-focus-inputs/main/demo/demo.gif\" alt=\"Usage With Simple Form\" width=\"30%\" /\u003e\n\u003c/div\u003e\n\nCheck out example project on\n[expo snack](https://snack.expo.dev/@groszczu/use-auto-focus-inputs).\n\n## Contribution\n\nSuggestions and PR-s are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGroszczu%2Fuse-auto-focus-inputs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGroszczu%2Fuse-auto-focus-inputs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGroszczu%2Fuse-auto-focus-inputs/lists"}