{"id":21050557,"url":"https://github.com/geminidsystems/react-native-select-attachment","last_synced_at":"2026-04-21T16:38:30.184Z","repository":{"id":57339876,"uuid":"290300191","full_name":"GeminidSystems/react-native-select-attachment","owner":"GeminidSystems","description":"Select new or existing photos, videos, files from your device for use in react-native","archived":false,"fork":false,"pushed_at":"2022-12-09T17:09:59.000Z","size":57,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-17T19:03:30.519Z","etag":null,"topics":["camera","drive","files","google","photo","picker","react-native"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/GeminidSystems.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-08-25T19:04:57.000Z","updated_at":"2023-07-06T07:07:09.000Z","dependencies_parsed_at":"2023-01-25T15:46:29.911Z","dependency_job_id":null,"html_url":"https://github.com/GeminidSystems/react-native-select-attachment","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/GeminidSystems/react-native-select-attachment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeminidSystems%2Freact-native-select-attachment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeminidSystems%2Freact-native-select-attachment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeminidSystems%2Freact-native-select-attachment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeminidSystems%2Freact-native-select-attachment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeminidSystems","download_url":"https://codeload.github.com/GeminidSystems/react-native-select-attachment/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeminidSystems%2Freact-native-select-attachment/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260424783,"owners_count":23007044,"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":["camera","drive","files","google","photo","picker","react-native"],"created_at":"2024-11-19T15:34:19.303Z","updated_at":"2026-04-21T16:38:30.097Z","avatar_url":"https://github.com/GeminidSystems.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n#  `react-native-select-attachment`\n\n## Supported Versions\n| react-native-select-attachment | react-native |\n| --- | --- |\n| \u003e= 0.0.1 | 0.60+\n\n## Description\n\n`react-native-select-attachment` allows the selection of photos, videos, or other files (local or cloud storage like Google Drive, Dropbox, Box). The `fileName`, `fileType`, and `base64` file data are returned to react-native. This is useful if you want to display or store file data from the device into your application.\n\n![preview](https://geminid.s3-us-west-1.amazonaws.com/img/react-native-select-attachment.png)\n\n\n## Getting Started\n\n`$ npm install react-native-select-attachment --save`\n\n#### Android\nNot supported in the current release, check back for future releases or create a PR\n\n#### iOS\nCocoaPods on iOS needs this extra step\n\n```\nnpx pod-install\n```\n\nTo use the react-module, you'll first have to write some privacy descriptions for accessing the photo library and the camera. Open your `Info.plist` as source and populate the usage descriptions as shown below:\n``` xml\n\u003ckey\u003eNSMicrophoneUsageDescription\u003c/key\u003e\n\u003cstring\u003eFor people to hear you during meetings, we need access to your microphone.\u003c/string\u003e\n\u003ckey\u003eNSCameraUsageDescription\u003c/key\u003e\n\u003cstring\u003eThis app wants to take pictures.\u003c/string\u003e\n\u003ckey\u003eNSPhotoLibraryUsageDescription\u003c/key\u003e\n\u003cstring\u003eThis app wants to use your photos.\u003c/string\u003e\n```\n## Usage\nTo import into your react app, import the SelectAttachmentButton component.\n```javascript\nimport SelectAttachment from 'react-native-select-attachment';\n```\nAnd call `showPicker` as shown below:\n```javascript\nvar options = {\n    maxFileSize: 10,\n    fileTypes: ['png', 'jpg', 'pdf'],\n    disableCameraPhotos: false,\n    disableCameraVideos: false,\n    disablePhotos: false,\n    disableVideos: false,\n    disableFiles: false,\n    cameraLabel: 'Camera',\n    albumLabel: 'Album',\n    filesLabel: 'Files',\n    enableImageScaling : true,\n    imageScale : 0.90,\n    maxImageWidth : 950\n};\n\nSelectAttachment.showPicker(options, (res) =\u003e {\n    if(res.error){\n        console.error(res.error);\n    } else {\n        console.error(res.fileName);\n        console.error(res.fileType);\n        console.error(res.base64);\n    }\n});\n```\n\n\n\n\n\n# Reference\n\n## Options\n\n### `maxFileSize`\n\nThe max file size allowed of the selected file (in MB)\n\n| Type     | Required | Default |\n| -------- | -------- | ----- |\n| [String] | No       | null |\n\n---\n\n### `fileTypes`\n\nThe file types that will be allowed for selection (in Files). If left blank all file types are allowed for selection\n\nSupported options are:\n- png\n- pdf\n- jpg\n- csv\n\n\n| Type     | Required | Default |\n| -------- | -------- | ----- |\n| [String] | No       | ['all'] |\n\n---\n\n### `disablePhotos`\n\nDisables the `Camera` from the popup options\n\n| Type     | Required | Default |\n| -------- | -------- | -------- |\n| Boolean | No       | false |\n\n---\n\n### `disableFiles`\n\nDisables the `Files` from the popup options\n\n| Type     | Required | Default |\n| -------- | -------- | -------- |\n| Boolean | No       | false |\n\n---\n\n### `cameraLabel`\n\nOverrides the label for `Camera` popup\n\n| Type     | Required | Default |\n| -------- | -------- | -------- |\n| String | No       | 'Camera' |\n\n---\n\n\n### `albumLabel`\n\nOverrides the label for `Album` popup\n\n| Type     | Required | Default |\n| -------- | -------- | -------- |\n| String | No       | 'Album' |\n\n---\n\n### `filesLabel`\n\nOverrides the label for `Files` popup\n\n| Type     | Required | Default |\n| -------- | -------- | -------- |\n| String | No       | 'Files' |\n\n---\n\n### `enableImageScaling`\n\nAllows scaling images to reduce file size.\n\n| Type     | Required | Default |\n| -------- | -------- | -------- |\n| Boolean | No       | false |\n\n---\n\n### `imageScale`\n\nIf `enableImageScaling` is true, the image resolution is reduced by a percentage entered. Example 0.5 would reduce the resolution by 50%\n\n| Type     | Required | Default |\n| -------- | -------- | -------- |\n| Decimal | No       | 1.0 |\n\n---\n\n### `maxImageWidth`\n\nThe max width of the image in pixels. Images will be scaled to the entered value. This is useful to reduce file size.\n\n| Type     | Required | Default |\n| -------- | -------- | -------- |\n| Integer | No       | 950 |\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeminidsystems%2Freact-native-select-attachment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeminidsystems%2Freact-native-select-attachment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeminidsystems%2Freact-native-select-attachment/lists"}