Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
react-table-lib
Advanced tools
yarn add react-table-lib
import Table from 'react-table-lib'
Basic Table
const data = [
{ name: "Earline Stokes", age: 30 },
{ name: "Amina Bergstrom", age: 25 },
{ name: "Kattie Hoppe", age: 20 }
]
return (
<Table data={data}>
)
Column mapped
const data = [
{ name: "Earline Stokes", age: 30 },
{ name: "Amina Bergstrom", age: 25 },
{ name: "Kattie Hoppe", age: 20 }
]
const columns = {
name: { label: "Full Name", sortable: true },
age: { label: "Age", format: (data) => data + 'yrs' }
}
return (
<Table data={data} columns={columns}>
)
Selectable
const data = [
{ name: "Earline Stokes", age: 30 },
{ name: "Amina Bergstrom", age: 25 },
{ name: "Kattie Hoppe", age: 20 }
]
const columns = {
name: { label: "Full Name", sortable: true },
age: { label: "Age", format: (data) => data + 'yrs' }
}
const handleSelect = (data) => {
// do something
// data [{ name: "Earline Stokes", age: 30 }]
}
return (
<Table data={data} columns={columns} selectable="multiple" onSelect={handleSelect}>
)
Props/Methods | Default | Type | Required | Details |
---|---|---|---|---|
data | - | array | true | Table Records in array format with each entry holding key : value pair |
columns | {} | object | false | Each property for data's entry's header property Ref: Columns |
selectable | - | 'single' 'multiple' | false | Selectable option to select table record based on type single or multiple |
onSelect | - | function | false | Callback to get selected records details.callback data : record (or) array of records |
Property | type | Details |
---|---|---|
label | string | Table Header column name |
sortable | boolean | Column sortable property |
format | function | Formatting table record for the same column |
Note: Please run
yarn storybook
to see demo. You can run this in your local too to check the same
FAQs
React responsive table library
The npm package react-table-lib receives a total of 1 weekly downloads. As such, react-table-lib popularity was classified as not popular.
We found that react-table-lib demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.