MultipleImagePicker
A component for selecting and managing multiple images.
MultipleImagePicker
A component that allows users to select and preview multiple images, with options to delete or add more images.
Import
Features
- Select multiple images from device
- Display image previews
- Main image + additional images layout
- Delete functionality for each image
- Customizable appearance
Props
Prop | Type | Default | Description |
---|---|---|---|
images | { uri: string }[] | — | Array of image objects to display |
setImages | (images: { uri: string }[]) => void | — | Callback to update images array |
mainImage | { uri: string } | — | Primary image to highlight |
setMainImage | (image: { uri: string }) => void | — | Callback to update main image |
maxImages | number | 10 | Maximum number of images allowed |
containerStyle | StyleProp<ViewStyle> | — | Custom style for container |
Basic Usage
Without Main Image
If you need to collect multiple images without highlighting a main one:
Implementation
The component uses expo-image-picker
to access the device's media library and presents the selected images in a horizontal scroll layout. Users can tap on empty slots to add images or tap the trash icon on existing images to remove them.