🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

msb-react-data-table

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

msb-react-data-table

``` import './App.css'; import DataTable from "msb-react-data-table";

2.0.1
latest
npm
Version published
Weekly downloads
3
Maintainers
0
Weekly downloads
 
Created
Source

msb-react-data-table

#for Javascript

import './App.css';
import DataTable from "msb-react-data-table";


function App() {
  const data = [
    { id: 1, name: 'John Doe', email: 'john.doe@example.com', date: '2023-01-01' },
    { id: 2, name: 'Jane Smith', email: 'jane.smith@example.com', date: '2023-02-01' },
    { id: 3, name: 'Michael Johnson', email: 'michael.johnson@example.com', date: '2023-03-01' },
  ]

  const columns = [
    { title: 'ID', field: 'id', sortable: true },
    { title: 'Name', field: 'name', sortable: true },
    { title: 'Email', field: 'email', sortable: true },
    {
      title: 'Date',
      field: 'date',
      sortable: true,
      render: (row) => <span>{row.date} </span>
    },
  ];


  return (
    <div className="App">
      <DataTable data={data} columns={columns} rowsPerPage={5}
        defaultSortKey="date" defaultSortDirection="desc"
        options={{ border: 1, width: '100%' }} />
    </div>
  );
}

export default App;

#for typescript

import './App.css';
import DataTable,{Column} from "msb-react-data-table";
interface User {
  id: number;
  name: string;
  email: string;
  date: string;
}

function App() {
 const data: User[] = [
    { id: 1, name: 'John Doe', email: 'john.doe@example.com', date: '2023-01-01' },
    { id: 2, name: 'Jane Smith', email: 'jane.smith@example.com', date: '2023-02-01' },
    { id: 3, name: 'Michael Johnson', email: 'michael.johnson@example.com', date: '2023-03-01' },
  ]

const columns: Column<User>[] = [
    { title: 'ID', field: 'id', sortable: true },
    { title: 'Name', field: 'name', sortable: true },
    { title: 'Email', field: 'email', sortable: true },
    {
      title: 'Date',
      field: 'date',
      sortable: true,
      render: (row) => <span>{row.date} </span>
    },
  ];


  return (
    <div className="App">
      <DataTable data={data} columns={columns} rowsPerPage={5}
        defaultSortKey="date" defaultSortDirection="desc"
        options={{ border: 1, width: '100%' }} />
    </div>
  );
}

export default App;

npm Install

npm msb-react-data-table

yarn Install

yarn msb-react-data-table

Typescript

 "dependencies": {
    "react": "^18.2.0",
    "typescript": "^4.8.4"
  },
  "devDependencies": {
    "@types/react": "^18.3.3"
  }

Keywords

react-data-table

FAQs

Package last updated on 02 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