npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-viewdrop-ios

v0.2.2

Published

ViewDrop is a module for React Native that will allow View to use a native iOS feature to transfer pictures, videos, files, and more through a simple Drag & Drop action.

Downloads

1

Readme

react-native-viewdrop-ios

ViewDrop is a module for React Native that will allow View to use a native iOS feature to transfer pictures, videos, files, and more through a simple Drag & Drop action.

Work of library GIF

Installation

npm install react-native-viewdrop-ios
yarn add react-native-viewdrop-ios

Supported platforms

Now this native Apple System feature only.

  • [x] iOS
  • [ ] macOS - on development

Platforms that will not be supported unless they have native features on them

  • [ ] tvOS
  • [ ] visionOS
  • [ ] Android
  • [ ] Windows
  • [ ] Web

Usage

Simply wrap your view for enable iOS native feature!

import { ViewDrop } from 'react-native-viewdrop-ios';

// ...

<ViewDrop style={styles.container}
    onImageReceived={setImage}
    onDropItemDetected={() => some logic for start dropping}
    onVideoReceived={({fileName : string, fullUrl : string}) => {
      some logic with path of video file
    }}
    onAudioReceived={({fileName : string, fullUrl : string}) => {
      some logic with path of audio file
    }}
    fileTypes={['image', 'audio']}
    whiteListExtensions={['png', 'jpeg']}
    blackListExtensions={['mp3']}
>
  // your views
</ViewDrop>;

| Prop | Description | | ------------------ | ------------------------------- | | onImageReceived | ( image : base64_string ) => void | | onDropItemDetected | () => void | | onVideoReceived | ( fileName : string, fullUrl : string ) => void | | onAudioReceived | ( fileName : string, fullUrl : string ) => void | | fileTypes | 'image' ,'video','audio' | | whiteListExtensions | string[] | | blackListExtensions | string[] |

Props

fileTypes

Array of allowed file types. Supports following values:

  • 'image' - allows image files
  • 'video' - allows video files
  • 'audio' - allows audio files
fileTypes?: ('image' | 'video' | 'audio')[]

whiteListExtensions

Array of allowed file extensions. Only files with specified extensions will be accepted. If not provided, all extensions are allowed (within fileTypes constraints if specified).

whiteListExtensions?: string[]

blackListExtensions

Array of forbidden file extensions. Files with specified extensions will be rejected. If not provided, no extensions are blocked.

blackListExtensions?: string[]

Examples

Basic usage with file types

import ViewDrop from 'react-native-view-drop';

// Allow only images and videos
<ViewDrop fileTypes={['image', 'video']} />

Using white list extensions

// Allow only PNG and JPG files
<ViewDrop whiteListExtensions={['png', 'jpg', 'jpeg']} />

// Allow only PNG and JPG images
<ViewDrop
  fileTypes={['image']}
  whiteListExtensions={['png', 'jpg', 'jpeg']}
/>

Using black list extensions

// Block specific file types
<ViewDrop blackListExtensions={['exe', 'bat', 'sh']} />

Combining white and black lists

// Allow PNG and JPG, but block HEIC
<ViewDrop
  whiteListExtensions={['png', 'jpg', 'jpeg']}
  blackListExtensions={['heic']}
/>

Priority and combinations

  • If only fileTypes is specified, any file of those types is allowed
  • If whiteListExtensions is specified, only files with listed extensions are allowed
  • If blackListExtensions is specified, files with listed extensions are blocked
  • When combining multiple constraints:
    • File must match fileTypes (if specified)
    • AND must match whiteListExtensions (if specified)
    • AND must not match blackListExtensions (if specified)

Notes

  • If you want restrict or add file such as doc,txt, pdf and e.t.c - should use combination of whileListExtensions and blackListExtensions.
  • If you don't care about specific file extensions within images, video, audio - you should ONLY use the fileTypes field. Apple's generalized types are used there
  • If you want add some specific type to fileTypes, for example .ogg for audio. You should use combination of fileTypes and whiteListExtensions :
 <ViewDrop
      style={styles.container}
      ... other props
      fileTypes={['image', 'audio']}
      // in this example whileListExtensions works as a type set extender
      whiteListExtensions={['ogg']}
    >

Future Plans

  • Settings for resize images
  • Works with preview of dropping
  • Works with multiple files drop
  • MacOS supports
  • Fabric supports

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library