Usage
Understanding the Data Grid
The Data Grid is a complex component that provides a wide range of features for displaying and interacting with data. It includes a variety of helpers to create an enhanced developer experience.
Step 1: The Data
The DataGrid accepts any form of data structures. Data is not what drives the component - defined columns are. All that matters for your data is that it is typed.
Step 2: Setup Columns
Columns are the engine that run the Data Grid.
Columns are defined using the createColumnHelper. This will provide a strictly
typed interface for defining individual columns.
Pass in your data type to the createColumnHelper function and build your columns.
Creating Columns
Once you have setup your helper singleton, you can start building columns.
There are three methods available to create columns:
display: Non-interactive columns.accessor: Interactive columns that utilize thefeaturesoptions.accessorFn: Interactive columns that allow your to define custom logic for rendering cells.
You can learn more about the columns in on the Columns page.
Use the DataGrid
The final step is to add the DataGrid component to your application. You simply pass in the data, columns, and any other feature-related props.
Note
For contstrained layouts (seen in the demo preview), we recommend wrapping the DataGrid in a container that has a strict height defined.
The next pages cover each feature in detail.