New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-auto-table-ts

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-auto-table-ts

A table component for react

latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

REACT-AUTO-TABLE-TS

=====================================

Table of Contents

  • Installation

  • Usage

  • Props

  • Extra Props

  • Result

Installation

To install the package, use the following command:


npm i react-auto-table-ts

Usage

To use the package, import the Table component and pass in a list of data:


import { Table } from 'react-auto-table-ts';

const data = [

  {

    "firstName": "Ava",

    "lastName": "Hall",

    "dateOfBirth": "1985-03-15",

    "startDate": "2020-08-01",

    "street": "1234 Main St",

    "city": "Springfield",

    "state": "IL",

    "zipCode": "62701",

    "department": "Sales"

  },

  {

    "firstName": "Liam",

    "lastName": "Brown",

    "dateOfBirth": "1992-05-03",

    "startDate": "2020-04-01",

    "street": "5678 Oak St",

    "city": "Decatur",

    "state": "IL",

    "zipCode": "62523",

    "department": "Marketing"

  }

];

<Table list={data} />

Props

The Table component accepts the following props:

  • list: an array of objects (required)

  • extraProps: an object with optional properties (see below)

Extra Props

The extraProps object can contain the following properties:

  • displayHeader: a boolean indicating whether to display the header (default: true)

  • displaySearch: a boolean indicating whether to display the search bar (default: true)

  • displayPagination: a boolean indicating whether to display pagination (default: true) (note: if displayPagination is set to false, all data will be display on the same page and the numberByPage selector will be removed)

  • displayPageSize: a boolean indicating whether to display selector of number by page (default: true)

  • numberByPage: an array of numbers indicating the number of items to display per page (default: [10, 20, 50, 100])

Example:


extraProps={{

  displayHeader: false,

  displaySearch: false,

  displayPagination: false,

  numberByPage: [10, 20, 30]

}}

Result

The resulting table will display the data in a tabular format without extraProps

alt text

Keywords

react

FAQs

Package last updated on 18 Sep 2024

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