{"id":15011810,"url":"https://github.com/fakundo/react-input-focus","last_synced_at":"2026-01-05T02:14:33.689Z","repository":{"id":40289582,"uuid":"240516869","full_name":"fakundo/react-input-focus","owner":"fakundo","description":"Focus switcher for React and Preact input components","archived":false,"fork":false,"pushed_at":"2022-12-12T01:55:07.000Z","size":1605,"stargazers_count":0,"open_issues_count":19,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T13:08:46.484Z","etag":null,"topics":["focus","input","react"],"latest_commit_sha":null,"homepage":"https://fakundo.github.io/react-input-focus/react/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fakundo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-14T13:41:35.000Z","updated_at":"2021-04-15T08:32:14.000Z","dependencies_parsed_at":"2023-01-27T10:30:42.565Z","dependency_job_id":null,"html_url":"https://github.com/fakundo/react-input-focus","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fakundo%2Freact-input-focus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fakundo%2Freact-input-focus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fakundo%2Freact-input-focus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fakundo%2Freact-input-focus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fakundo","download_url":"https://codeload.github.com/fakundo/react-input-focus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244900238,"owners_count":20528668,"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":["focus","input","react"],"created_at":"2024-09-24T19:41:44.683Z","updated_at":"2026-01-05T02:14:33.645Z","avatar_url":"https://github.com/fakundo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-input-focus / preact-input-focus\n\n[![npm](https://img.shields.io/npm/v/react-input-focus.svg)](https://www.npmjs.com/package/react-input-focus)\n\nFocus switcher for React and Preact input components.\n\n### Installation\n  \nFor React\n```\nyarn add react-input-focus\n```\n  \nFor Preact\n```\nyarn add preact-input-focus\n```\n\n### Demo\n\n[Demo](https://fakundo.github.io/react-input-focus/react/)\n/\n[Source](https://github.com/fakundo/react-input-focus/tree/master/packages/react-input-focus/examples)\n\n### Usage\n\n```javascript\nimport { FocusableProvider, FocusableInput } from 'react-input-focus' // or from 'preact-input-focus'\n\nconst Input = props =\u003e (\n  \u003cFocusableInput\u003e\n    { ({ focusableInputRef, focusNextInput }) =\u003e (\n      \u003cinput\n        {...props}\n        ref={focusableInputRef}\n        onKeyPress={(ev) =\u003e {\n          if (ev.key === 'Enter') {\n            focusNextInput()\n          }\n        }}\n      /\u003e\n    ) }\n  \u003c/FocusableInput\u003e\n)\n\nexport default () =\u003e (\n  \u003cFocusableProvider\u003e\n    \u003cFragment\u003e\n      \u003cInput placeholder=\"#1 Focus next input on Enter\" /\u003e\n      \u003cInput placeholder=\"#2 Focus next input on Enter\" /\u003e\n      \u003cInput placeholder=\"#3\" /\u003e\n    \u003c/Fragment\u003e\n  \u003c/FocusableProvider\u003e\n)\n```\n\n### API\n\n#### `FocusableInput` props\n\n- `children(focusableValue)`\n- `index` - overrides input index and changes focus order\n\n#### `focusableValue` has the following structure\n\n- `focusableInputRef()`\n- `focusInput(index)`\n- `focusNextInput()`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffakundo%2Freact-input-focus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffakundo%2Freact-input-focus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffakundo%2Freact-input-focus/lists"}