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

kanneh-datatable

v3.0.4

Published

Data Tables makes working and creating CRUD very easy

Downloads

432

Readme

React Native Data Table Conmponent

Data Tables makes working and creating crude applications in react native very easy. It provide Table component with search capabilities, editor included, pagination and insight into the total records filters and selections. It simple editor allow you/ your users to easily add, edit or delete records. It support JSON Array data, server served json, or processed data from the server.

Installation

npm install kanneh-datatable

Usage

<DataTable 
    columns={
        tableColumns
    } 
    data={
        tableData
    }
    ......
/>

Properties

DataTableProps


{
    columns?: DataTableColumnProps[];
    data?: any[];
    ajax?: AjaxProp,
    height?: number;
    loading?: boolean;
    error?: string; 
    buttons?: ButtonProps[];
    allowAdd?: boolean;
    onBeforeAdd?: (item:any)=>any;
    onAdd?: (item:any)=>any;
    select?: boolean;
    serverSide?:boolean;
    allowEdit?: boolean;
    onBeforeEdit?: (item: any) => any;
    onEdit?: (item: any) => void
    allowDelete?: boolean;
    onBeforeDelete?: (item: any) => boolean;
    onDelete?: (item: any) => void;
    options?: Record<string, any>
}

columns

The columns for the tables see DataTableColumnProps

data

JSON array Data

ajax

parameters to connect to server for json data or for processing see AjaxProp

height

Height of the table body

loading

external variable that signal to the table to wait for params

error

external error to be displayed by the table

buttons

Buttons that will appear on the table in addition to internal buttons see ButtonProps

allowAdd

triggers editor and add internal button for adding records

onBeforeAdd

callback called before adding item to table. it returns edited version of the item which is finnaly added to the data table's data or before sent to server.

onAdd

callback called after adding the item to data tables data or after submission to server

select

Boolean controls row selections

serverSide

Boolean informs data table that all process should be sent to server

DataTableColumnProps

column definition

{
    data: string;
    title?: string;
    align?: 'left' | 'right' | 'center';
    render?: (item: any,row: any[], renderType:string)=>ReactNode
    type?: 'string' | 'number' | 'date' | 'dropdown' | 'grid';
    sortable?: boolean;
    addable?: boolean;
    editable?: boolean;
    editor?: (item:any, valueChange:(value:any)=>void)=>ReactNode;
    searchable?: boolean;
    options?: {label?:string,value:any}[];
    multiple?: boolean;
}

AjaxProp

export interface AjaxProp {
    url: string,
    headers?: any,
    params?: any 
}

ButtonProps extends ViewProps

{
    text?: string;
    action: (event:any,api:Api) => void;
    disabled?: boolean
}