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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-table-component-mroads

v1.0.6

Published

TODO

Downloads

11

Readme

react-native-table-component

This is a custom table component which can be used to create a tabular data of n entries based upon our requirements.

Installation

Use the package manager to install.

$ npm install react-native-table-component-mroads --save

or

$ yarn add react-native-table-component-mroads

Usage

| Prop | Required| Default | Type | Description | | :---------------- | :-------------: | :-------------: | :------: | :---------------------------------------------------------------------------------------------------------- | | header | true | - | Array<header> | It is an array of the number of columns that is going to be present in the table.| | data | true | - | Array<data> | It is an array of Objects containing the entries that needs to go in the table.| | containerStyle | false | - | - | The style of the container in which the table exists.|

Description of the Props passed:

  1. header: It is an array of the number of columns you are going to have in your table. Refer below the structure of the Array that needs to be maintained. Make sure you use the same name of the items referred below.

|Property|Description|Type| | :---------------- | :-------------: | :-------------: | | text | The name of the column you want | String | | containerStyle | The style of the individual column you want | Object |
|renderCell | A callback function that gets executed for every individual entry of the column | Component |
|key | A unique value that identifies every single column in the DOM. | - |

  1. data: It is an array of key value pairs that contain the entries of a single row.

|property|description| | :---------------- | :-------------: | |{ Col1.key: "value you give" }, | It shohuld be of the same type as of the header. | NOTE: The number of key value pairs should be equal to the number of columns you have.

Example

import React from 'react';
import {
  StyleSheet,
  View,
  Text,
  Button,
} from 'react-native';

import {
  Colors,
} from 'react-native/Libraries/NewAppScreen';
import CustomTable from 'react-native-table-component';


class App extends React.Component {
  tableHead = [ 
    {
      text: 'Name',
      containerStyle: styles.coloumnContainerStyle,
      textStyle: { fontSize: 20, textAlign: 'center' },
      renderCell: data => (
        <View
          style={styles.tableData}
        >
          <Text style={styles.bodyContent}>{data.name}</Text>
        </View>
      ),
    },
    {
      text: 'Age',
      containerStyle: styles.coloumnContainerStyle,
      textStyle: { fontSize: 20, textAlign: 'center' },
      renderCell: data => (
        <View
          style={styles.tableData}
        >
          <Text style={styles.bodyContent}>{data.age}</Text>
        </View>
      ),
    },
    {
      text: 'Drop',
      containerStyle: styles.coloumnContainerStyle,
      textStyle: { fontSize: 20, textAlign: 'center' },
      renderCell: data => (
        <View style={styles.tableData}>
          <Button
          title="Remove"
          color="red"
          onPress={() => this.removeEntryHandler(data)}
        />
        </View>
      ),
    },
  ];

  state = {
    tableData : [
      {
        name: 'Allen',
        age: '32',
        desg: 'Norwegian DJ',
        location: 'Northampton',
        uniqueID: 1,
        fullName: 'Allen Walker',
      },
      {
        name: 'Enrique',
        age: '37',
        desg: 'Singer-Songwriter',
        location: 'Madrid',
        uniqueID: 2,
        fullName: 'Enrique Iglesias',
      },
    ],
    selectedState: null,
  };

  removeEntryHandler = data => {
    const { tableData } = this.state;
    const tempData = [...tableData];
    const index = tempData.findIndex(t => t.uniqueID === data.uniqueID);
    tempData.splice(index, 1);
    this.setState({ tableData: tempData });
  }

  selectedStateHandler = data => {
    const { selectedState, tableData } = this.state;
    const index = tableData.find(t => t.uniqueID === data.uniqueID);
    this.setState({ selectedState: index });
  }

  render(){
    const { tableData, selectedState } = this.state;
    return(
      <View style={{ flex: 1 }}>
        <CustomTable 
          headerConfig={this.tableHead}
          bodyConfig={tableData}
        />
        {selectedState ? <View style={{ height: 400, alignItems: 'center', justifyContent: 'center' }}>
          <Text style={{ fontSize: 35 }}>Full Name: {selectedState.fullName}</Text>
          <Text style={{ fontSize: 35 }}>Age: {selectedState.age}</Text>
          <Text style={{ fontSize: 35 }}>Location: {selectedState.location}</Text>
          <Text style={{ fontSize: 35 }}>Designation: {selectedState.desg}</Text>
        </View> : null }
      </View>
    );
  }
}


const styles = StyleSheet.create({
  coloumnContainerStyle: {
    flex: 1,
    marginRight: 13.3,
  },
  tableHeader: {
    fontSize: 16,
    color: '#A4A4A4',
    letterSpacing: 0,
    marginBottom: 13.3,
  },
  tableData: { height: 54, justifyContent: 'center' },
  buttonStyle: { marginBottom: 100 },
  notificationImg: { height: 34, width: 34 },
  bodyContent: { width: '100%', textAlign: 'center' },
});

export default App;