Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@material-ui/x-grid
Advanced tools
The Material-UI X edition of the data grid component.
Check out our Demo here!
Using your favorite package manager, install @material-ui/x-grid
:
// with npm
npm install @material-ui/x-grid
// with yarn
yarn add @material-ui/x-grid
This component has 3 peer dependencies that you will need to install as well.
"peerDependencies": {
"@material-ui/core": "^4.11.0",
"react": "^16.13.1",
"styled-components": "^5.1.0"
},
After installing the package, you are now ready to use the grid. First you have to import the component as below.
import { XGrid } from '@material-ui/x-grid';
Then you need to create some columns which are simple objects containing at least a field property.
You can import ColDef
to see all column properties.
A simple set of column can be.
const columns = [{ field: 'id' }, { field: 'name', headerName: 'Client Name' }...];
Rows are string key value pair objects.
const rows = [{ id: 1, name:'Jon Snow' }, { id: 2, name: 'Tyrion Lannister' }...];
A complete example below.
import * as React from 'react';
import { XGrid, ColDef } from '@material-ui/x-grid';
const columns: ColDef[] = [
{ field: 'id' },
{ field: 'firstName' },
{ field: 'lastName' },
{
field: 'age',
cellClassName: ['age'],
headerClassName: ['age'],
type: 'number',
sortDirection: 'desc',
},
{
field: 'fullName',
description: 'this column has a value getter and is not sortable',
headerClassName: 'highlight',
sortable: false,
valueGetter: (params) =>
`${params.getValue('firstName') || ''} ${
params.getValue('lastName') || ''
}`,
},
];
const rows = [
{ id: 1, lastName: 'Snow', firstName: 'Jon', age: 35 },
{ id: 2, lastName: 'Lannister', firstName: 'Cersei', age: 42 },
{ id: 3, lastName: 'Lannister', firstName: 'Jaime', age: 45 },
{ id: 4, lastName: 'Stark', firstName: 'Arya', age: 16 },
{ id: 5, lastName: 'Targaryen', firstName: 'Daenerys', age: null },
{ id: 6, lastName: 'Melisandre', firstName: null, age: 150 },
];
export default function MyApp() {
return (
<div style={{ width: 800, height: 600 }}>
<XGrid
rows={rows}
columns={columns}
options={{ checkboxSelection: true }}
/>
</div>
);
}
Code Sandbox here!
FAQs
The commercial edition of the data grid component (Material-UI X).
The npm package @material-ui/x-grid receives a total of 1,235 weekly downloads. As such, @material-ui/x-grid popularity was classified as popular.
We found that @material-ui/x-grid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers 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.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.