0.0.15 • Published 10 months ago

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

Weekly downloads
-
License
MIT
Repository
github
Last release
10 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

10 months ago

0.0.14

10 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago