Socket
Socket
Sign inDemoInstall

usereactable

Package Overview
Dependencies
5
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    usereactable

UseReactTable is a React package that provides fast, flexible, and simple data tables for displaying tabular data. It supports features such as sorting, filtering, and pagination and is built on the power of [React.js](https://reactjs.org/).


Version published
Weekly downloads
6
decreased by-50%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

UseReactTable

UseReactTable is a React package that provides fast, flexible, and simple data tables for displaying tabular data. It supports features such as sorting, filtering, and pagination and is built on the power of React.js.

Features

  • Single Component Integration: Easily integrate a feature-rich data table with just one component.
  • Customizable: Tailor the appearance and behavior of the table to meet your specific requirements.
  • Pagination, Sorting, Search, Filtering: Efficiently manage and display data with built-in features.
  • Resizable Columns: Resize columns to optimize the viewing experience.
  • Selection: Support row selection for actions like deletion or further processing.
  • Responsive Design: Ensure a seamless experience across different screen sizes.

Installation

Using NPM

To use UseReactTable in your React project, install it via npm:

npm install --save usereactable

There might be hidden bugs lurking around any corner. I'll try to tag any releases with breaking changes.

Note: Feel free to submit new issues here.

Table of Contents

## Usage/Examples

The simplest example:

import { useEffect, useState } from "react";
import Datatable from "usereactable";

const App = () => {
  const columns = [
    {
      headerName: "First Name",
      field: "firstName",
    },
    {
      headerName: "Last Name",
      field: "lastName",
    },
    {
      headerName: "Maiden Name",
      field: "maidenName",
    },
    {
      headerName: "Maiden Name",
      field: "image",
    },
    {
      headerName: "Age",
      field: "age",
      style: {
        color: "green",
      },
    },
  ];
  const [data, setdata] = useState([]);
  useEffect(() => {
    fetch("https://dummyjson.com/users?limit=100")
      .then((res) => res.json())
      .then((data) => setdata(data.users.slice(0, 100)));
  }, []);

  return (
    <div>
      <Datatable
        rows={data}
        columns={columns}
        title={"Customer list"}
        actionButtons
        excelDownload
        pagination
      />
    </div>
  );
};

export default App;

While pretty basic, this example demonstrates a couple things:

  • Import Datatable from usereacttable
  • Cols in the column that is gone be shown in react table
  • data is rows data which is gone be show in table
  • pagination keyword enable pagination to your table -React DOM attributes such as className will pass-through to the rendered <table>

Screenshots

App Screenshot

Props

NameTypeRequiredDefaultDescription
titlestringYesnullHeading of the table
rowsarrayYes[]array of objects
columnsarrayYesnullList of cols which gone be see in the table
subTitlestringYesundefinedSub-Heading of the table
styleCSS StylesNonullAdd styles to table container
classNamestringNonullAdd className to table container
tableheadstyleCSS StylesNoundefinedchange style of table heading
searchAblebooleanNotrueShow / Hide search box from table
tableheadstyleCSS StylesNoundefinedchange style of table heading
tablerowstyleCSS StylesNoundefinedchange style of table's row
paginationbooleanNofalseAdd pagination to table
actionButtonsbooleanObjectnofalse
selectionbooleanNofalseEnables / disable the row selection in table
excelDownloadbooleanNofalseEnables / disable the feature of download data in excel file
removefromExcelbooleanNoundefinedRemoves the key's from excel file from download
onEditBtnClickfunctionNoundefinedFunction on edit button click
onDeleteBtnClickfunctionNoundefinedFunction on delete button click
keysToExcludeFromViewstring[]Noundefinedhide keys from default view model
viewButtonReact ElementNoundefinedAdd custom view button in the table
editButtonReact ElementNoundefinedAdd custom edit button in the table
deleteButtonReact ElementNoundefinedAdd custom delete button in the table
modalClassNamestringNoundefinedadd classname to modal container
modalStyleReact Css PropertiesNoundefinedTo change modal style

Keywords

FAQs

Last updated on 12 Feb 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc