react-native-animated-gallery-view
Beautiful animated gallery style view for React Native.
This library uses react-native-reanimated library as a dependency to create animations that are super performant and run totally on the native thread.
Follow the installation instructions here: https://github.com/software-mansion/react-native-reanimated
Installation
npm install react-native-animated-gallery-view
Usage
Gallery view can get any views as items (passed as children). Set a reg to the GalleryView instance in order to access and use the provided method setLayout which allows you to transition between different gallery layouts (see code example below)
;;; { const gallery = useRef<GalleryViewProps>null; return <View style=stylescontainer> <Button title="Column" onPress= gallerycurrent! /> <Button title="Column Wrap" onPress= gallerycurrent! /> <Button title="Row" onPress= gallerycurrent! /> <Button title="Row Wrap" onPress= gallerycurrent! /> <GalleryView layout=GalleryLayoutColumn ref=gallery spacing=10 columnLayoutStyle= justifyContent: 'space-around' > <View style= backgroundColor: 'red' height: 100 width: 100 /> <View style= backgroundColor: 'blue' height: 100 width: 100 /> <View style= backgroundColor: 'black' height: 100 width: 100 /> <View style= backgroundColor: 'pink' height: 100 width: 100 /> <View style= backgroundColor: 'brown' height: 100 width: 100 /> <View style= backgroundColor: 'green' height: 100 width: 100 /> </GalleryView> </View> ;} const styles = StyleSheet;
License
MIT