Socket
Socket
Sign inDemoInstall

@mindinventory/react-native-stagger-view

Package Overview
Dependencies
Maintainers
7
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mindinventory/react-native-stagger-view

test


Version published
Weekly downloads
423
increased by80.77%
Maintainers
7
Weekly downloads
 
Created
Source

react-native-stagger-view

A @mindinventory/react-native-stagger-view package is used to show listing with the Staggered, It works like a normal Flatlist with included refreshing, loading, header, footer, renderItem, loaderView, custom style of header footer and container but it's managed dynamic height of the Item just you need give Item height in its style.

Animations

Fade In Slide-Left Slide-Down Effective Flipped

Installation

using npm:

npm install @mindinventory/react-native-stagger-view

using yarn:

yarn add @mindinventory/react-native-stagger-view

Supported platform

  • Android
  • Ios

Usage

import StaggeredList from '@mindinventory/react-native-stagger-view';
...

<StaggeredList
            data={imageURL}
            animationType={'FADE_IN_FAST'}
            contentContainerStyle={styles.contentContainer}
            showsVerticalScrollIndicator={false}
            renderItem={({item}) => renderChildren(item)}
            isLoading={isLoading}
            LoadingView={
              <View style={styles.activityIndicatorWrapper}>
                <ActivityIndicator color={'black'} size={'large'} />
              </View>
            }
          />

 const renderChildren = item => {
    return (
      <View style={getChildrenStyle()} key={item.id}>
        <View style={styles.avatarImage}>
          <Image
            onError={() => {}}
            style={styles.img}
            source={{
              uri: item.url,
            }}
            resizeMode={'cover'}
          />
        </View>
      </View>
    );
  };

const getChildrenStyle = () => {
    return {
      width: (SCREEN_WIDTH - 18) / 2,
      height: Number(Math.random() * 20 + 12) * 10,
      backgroundColor: 'gray',
      margin: 4,
      borderRadius: 18,
    };
  };

Documentation

PropTypeDescriptionDefault
animationTypeFADE_IN_FAST OR SLIDE_LEFT OR SLIDE_DOWN OR EFFECTIVE OR FLIPPED OR NONEAppying Animation to list or default NONE item.
innerRefMutableRefObject<ScrollView>ScrollView ref to be forwarded to the underlying scrollView.undefined
innerRefMutableRefObject<ScrollView>ScrollView ref to be forwarded to the underlying scrollView.undefined
keyPrefixstringUnique key for each item.
loadingbooleanif true, the loadingView will be shown on top of the list.false
refreshingRefreshControlProps['refreshing']Add pull to refresh in the list.
onRefreshRefreshControlProps['onRefresh']Callback function when user pull to refresh.
onEndReached() => voidcallback in scrollView onEndReached.
onEndReachedThresholdnumberThreshold in pixels (virtual, not physical) for calling onEndReached. It calls onEndReached if you scrolled to this pixels from the bottom.
styleStyleProp<ViewStyle>style object for the listing.
dataT[]Items to be rendered.
renderItem({item: T, i: number}) => ReactElementTakes an item from data and renders it into the list.
LoadingViewComponentType<any>Rendered while loading.
ListHeaderComponentComponentType<any>Rendered at the top of all the items.null
ListEmptyComponentComponentType<any>Rendered when the list is empty.null
ListFooterComponentComponentType<any>Rendered at the bottom of all the items.null
ListHeaderComponentStyleStyleProp<ViewStyle>Style of the header.
contentContainerStyleStyleProp<ViewStyle>Style of the content container style of the main scrollView.
containerStyleStyleProp<ViewStyle>Style of main scrollView.
numColumnsnumberMultiple columns can only be rendered.2

Changelog

Version: 1.2.0

  • Fixed Objects are not valid as a React child issue.

LICENSE!

@mindinventory/react-native-stagger-view is MIT-licensed.

Let us know!

We’d be really happy if you send us links to your projects where you use our component. Just send an email to sales@mindinventory.com And do let us know if you have any questions or suggestion regarding our work.

📌 Credits :

This project is made possible by the community surrounding it and especially the wonderful people. Rendering a list is basically clone form this repo GitHub Repo

Keywords

FAQs

Package last updated on 22 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc