Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-complete-flatlist

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-complete-flatlist

A complete flatlist with search bar, highlighted search, pull to refresh, and etc is ready to use

  • 1.1.15
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
138
increased by102.94%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-complete-flatlist

Extended version of react native flat list with many built in function such as search, pull to refresh, no data available message if empty row

ezgif-3-734272a58f

Usage :


import React, { Component } from 'react';
import { View, Text, Image, Platform, StatusBar } from 'react-native';
import CompleteFlatList from 'react-native-complete-flatlist';


const data = [
  { name: 'Fattah', status: 'Active', time: '8:10 PM', date: '1 Jan 2018' },
  { name: 'Syah', status: 'Active', time: '9:14 PM', date: '1 Dec 2018' },
  { name: 'Izzat', status: 'Active', time: '8:15 PM', date: '1 Jan 2018' },
  { name: 'Fattah', status: 'Active', time: '8:10 PM', date: '1 Jan 2018' },
  { name: 'Fattah', status: 'Active', time: '8:10 PM', date: '1 Jan 2018' },
  { name: 'Fattah', status: 'Active', time: '8:10 PM', date: '1 Jan 2018' },
  { name: 'Fattah', status: 'Active', time: '8:10 PM', date: '1 Jan 2018' },
  { name: 'Fattah', status: 'Active', time: '8:10 PM', date: '1 Jan 2018' },
  { name: 'Fattah', status: 'Active', time: '8:10 PM', date: '1 Jan 2018' },
  { name: 'Fattah', status: 'Active', time: '8:10 PM', date: '1 Jan 2018' },
  { name: 'Fattah', status: 'Active', time: '8:10 PM', date: '1 Jan 2018' },
  { name: 'Fattah', status: 'Active', time: '8:10 PM', date: '1 Jan 2018' },
  { name: 'Fattah', status: 'Active', time: '8:10 PM', date: '1 Jan 2018' },
  { name: 'Fattah', status: 'Active', time: '8:10 PM', date: '1 Jan 2018' },
  {
    name: 'Muhyiddeen',
    status: 'Blocked',
    time: '10:10 PM',
    date: '9 Feb 2018',
  },
];

class App extends Component {
  cell(data) {
    return <Text>{data.name}</Text>;
  }

  render() {
    const { navigation } = this.props;
    return (
      <CompleteFlatList
      searchKey={['name', 'status', 'time', 'date']}
      highlightColor="yellow"
      pullToRefreshCallback={() => {
        alert('refreshing');
      }}
      data={data}
      renderSeparator={null}
      renderItem={this.cell.bind(this)}
    />
    );
  }
}



Properties

PropTypeDescriptionDefaultRequired
dataarray of objectsData to be rendered in the list[]Required (come on, ofcourse u need data for this)
renderEmptyRowfunction that return a JSX elementWill be rendered when data is empty or search does not match any keyword()=><Text style={styles.noData}>{'No data available'}</Text>Optional
backgroundStylesstyle objectStyle of the flatlist backgroundnullOptional
searchBarBackgroundStylesstyle objectStyle of the searchbar backgroundnullOptional
pullToRefreshCallbackfunctionCallback function when user pull to refreshnullOptional (Pull to refresh will not be available if this is not supplied
isRefreshingbooleanif true, the loading will be shown on top of the listfalseOptional
renderItemfunction that return a JSX element (Just like RN's ListView and FlatList)Template of a row in the Flat Listnull (open for PR if anyone wish to make default template for this)Required (since I dont do default template yet)
renderSeparatorfunction that return a JSX element to be rendered between rows(Just like RN's ListView and FlatList)Template of separator in the Flat Lista thin lineOptional
placeholderstringPlaceholder of search field"Search ..."Optional
highlightColorcolorcolor of higlighted words background when match search keywordyellowOptional
searchKeyarray of stringThis should be name of keys available in data which will be use to searchnullOptional (if not supplied, search field will not appear)
elementBetweenSearchAndListJSX elementWhat to render between searchbar and the listnullOptional

Keywords

FAQs

Package last updated on 10 Jun 2018

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