npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mindinventory/react-native-stagger-view

v1.2.1

Published

test

Downloads

2,394

Readme

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

| Prop | Type | Description | Default | | ------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- | --------- | | animationType | FADE_IN_FAST OR SLIDE_LEFT OR SLIDE_DOWN OR EFFECTIVE OR FLIPPED OR NONE | Appying Animation to list or default NONE item. | | | innerRef | MutableRefObject<ScrollView> | ScrollView ref to be forwarded to the underlying scrollView. | undefined | | innerRef | MutableRefObject<ScrollView> | ScrollView ref to be forwarded to the underlying scrollView. | undefined | | keyPrefix | string | Unique key for each item. | | | loading | boolean | if true, the loadingView will be shown on top of the list. | false | | refreshing | RefreshControlProps['refreshing'] | Add pull to refresh in the list. | | | onRefresh | RefreshControlProps['onRefresh'] | Callback function when user pull to refresh. | | | onEndReached | () => void | callback in scrollView onEndReached. | | | onEndReachedThreshold | number | Threshold in pixels (virtual, not physical) for calling onEndReached. It calls onEndReached if you scrolled to this pixels from the bottom. | | | style | StyleProp<ViewStyle> | style object for the listing. | | | data | T[] | Items to be rendered. | | | renderItem | ({item: T, i: number}) => ReactElement | Takes an item from data and renders it into the list. | | | LoadingView | ComponentType<any> | Rendered while loading. | | | ListHeaderComponent | ComponentType<any> | Rendered at the top of all the items. | null | | ListEmptyComponent | ComponentType<any> | Rendered when the list is empty. | null | | ListFooterComponent | ComponentType<any> | Rendered at the bottom of all the items. | null | | ListHeaderComponentStyle | StyleProp<ViewStyle> | Style of the header. | | | contentContainerStyle | StyleProp<ViewStyle> | Style of the content container style of the main scrollView. | | | containerStyle | StyleProp<ViewStyle> | Style of main scrollView. | | | numColumns | number | Multiple 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 [email protected] 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