0.0.15 • Published 7 months ago

react-native-camera-roll-multiselect v0.0.15

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Camera Roll with Multiselect

A customizable gallery view for React Native with multi-select support. Built with Swift for iOS.

Alt Text

Installation

To install the library, run the following command:

npm i react-native-camera-roll-multiselect

Props

PropTypeDefaultDescription
styleViewStyleCustom styles for the gallery view container.
isMultiSelectEnabledbooleanfalseEnable or disable multi-select functionality.
multiSelectStyle{ mainColor: string; subColor: string }Customize colors for multi-select UI (circle and background).
onSelectMedia(media: MediaData) => voidCallback when a media item is selected.

Methods

getSelectedMedia

async getSelectedMedia(): Promise<MediaData[]>

Description: Returns a list of selected media objects. Returns: A promise that resolves with an array of MediaData objects representing the selected media.

Usage:

const selectedMedia = await galleryRef.current.getSelectedMedia();

Full Example:

import React, { useRef } from 'react';
import { GalleryView } from 'react-native-camera-roll-multiselect';

const App = () => {
  const galleryRef = useRef(null);

  const handleSelectMedia = (media) => {
    console.log(media);
  };

  const handleGetSelectedMedia = async () => {
    const selectedMedia = await galleryRef.current.getSelectedMedia();
    console.log(selectedMedia);
  };

  return (
    <>
      <Button title="Get Selected Media" onPress={handleGetSelectedMedia} />
      <GalleryView
        ref={galleryRef}
        style={{ flex: 1 }}
        onSelectMedia={handleSelectMedia}
        isMultiSelectEnabled={true}
        multiSelectStyle={{
          mainColor: 'blue',
          subColor: 'green',
        }}
      />
    </>
  );
};
0.0.15

7 months ago

0.0.14

7 months ago

0.0.13

7 months ago

0.0.12

7 months ago

0.0.11

7 months ago

0.0.10

7 months ago

0.0.9

7 months ago

0.0.8

7 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago