{"id":21302762,"url":"https://github.com/team-griffin/react-file-input","last_synced_at":"2026-04-29T09:31:35.845Z","repository":{"id":57164780,"uuid":"86466536","full_name":"team-griffin/react-file-input","owner":"team-griffin","description":"Unopinionated custom file input","archived":false,"fork":false,"pushed_at":"2017-04-14T18:14:42.000Z","size":73,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-27T05:42:01.939Z","etag":null,"topics":["files","forms","react"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@team-griffin/react-file-input","language":"JavaScript","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/team-griffin.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}},"created_at":"2017-03-28T13:57:25.000Z","updated_at":"2019-04-05T16:02:56.000Z","dependencies_parsed_at":"2022-08-29T19:11:50.363Z","dependency_job_id":null,"html_url":"https://github.com/team-griffin/react-file-input","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/team-griffin%2Freact-file-input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/team-griffin%2Freact-file-input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/team-griffin%2Freact-file-input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/team-griffin%2Freact-file-input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/team-griffin","download_url":"https://codeload.github.com/team-griffin/react-file-input/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243776656,"owners_count":20346353,"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":["files","forms","react"],"created_at":"2024-11-21T15:57:40.971Z","updated_at":"2026-04-29T09:31:30.802Z","avatar_url":"https://github.com/team-griffin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-file-input\n\n```sh\nnpm i --save @team-griffin/react-file-input\n\nyarn add @team-griffin/react-file-input\n```\n\nThis package allows you to design fancy file inputs, whilst not having an opinion on how you want to handle your forms or design.\n\n## Usage\n\n```jsx\nimport FileInput from '@team-griffin/react-file-input';\n\nreturn (\n  \u003cFileInput\n    id=\"a-unique-id-for-this-this-field\"\n    value={theListOfFilesNormallyStoredInReduxForm}\n    button={(\n      \u003cbutton type=\"button\"\u003e\n        The button displayed\n      \u003c/button\u003e\n    )}\n    onChange={(e) =\u003e howToHandleTheChange}\n  /\u003e\n);\n```\n\n**Note:** It is recommended that in your application you wrap this component so that you are not having to constantly recode it. I would suggest also calling your component `FileInput` and then importing this component as `ReactFileInput`.\n\n## Customization\n\nBy default the file input will automatically render the text and layout for you. But you are welcome to configure this as much as you desire.\n\nOn the `\u003cFileInput/\u003e` component there are 2 props `layout` and `text`. You can use these to augment how this component renders.\n\n```jsx\nconst MyText = ({\n  multiple,\n  value,\n}) =\u003e {\n  return (\n    \u003cspan\u003e\n      How ever you'd like to diplay your values.\n    \u003c/span\u003e\n  );\n};\n\nconst MyLayout = ({\n  input,\n  button,\n  text,\n  multiple,\n  value,\n}) =\u003e {\n  return (\n    \u003cdiv\u003e\n      Your structure.\n    \u003c/div\u003e\n  );\n};\n\nreturn (\n  \u003cFileInput\n    button={\u003cbutton\u003eMy Button\u003c/button\u003e}\n    layout={(\u003cMyLayout/\u003e)}\n    text={(\u003cMyText/\u003e)}\n  /\u003e\n);\n\n```\n\n## API\n\n### FileInput\n\nAll other props are passed through to the input.\n\n| Prop     | Description                             | Type    | Default |\n|----------|-----------------------------------------|---------|---------|\n| id*      | Field Id                                | String  |         |\n| value    | Array of values                         | Array   |         |\n| multiple | To support multiple values              | Bool    | false   |\n| button   | The button to render                    | Element |         |\n| text     | The text to render                      | Element | Text    |\n| layout   | The layout to render                    | Element | Layout  |\n| onChange | The callback for when the input changes | Func    |         |\n\n### Layout\n\nThe layout component is an internal component. But these are the props we pass to it or your custom one.\n\n| Prop     | Description                | Type    | Default |\n|----------|----------------------------|---------|---------|\n| value    | Array of values            | Array   |         |\n| multiple | To support multiple values | Bool    |         |\n| input    | The input render           | Element |         |\n| button   | The button to render       | Element |         |\n| text     | The text to render         | Element |         |\n\n### Text\n\nThe text component is an internal component. But these are the props we pass to it or your custom one.\n\n| Prop     | Description                | Type  | Default |\n|----------|----------------------------|-------|---------|\n| value    | Array of values            | Array |         |\n| multiple | To support multiple values | Bool  |         |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteam-griffin%2Freact-file-input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteam-griffin%2Freact-file-input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteam-griffin%2Freact-file-input/lists"}