Data Table
A table component with sorting, filtering, and pagination compatible with VitNode API.
Usage
Prop | Type | Default |
---|---|---|
pageInfo | {
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor: string;
endCursor: string;
} | - |
order | {
columns?: string[];
defaultOrder: {
column: string;
order: 'asc' | 'desc';
};
} | - |
edges | Array | - |
columns | {
id: string;
label: string;
cell?: (props: {
row: any;
allData: any[];
}) => JSX.Element;
}[] | - |
Cell Renderer
You can customize how each cell is rendered using the cell
property. The renderer function receives the current row data and all table data as parameters.
Order Configuration
If you want to enable sorting on specific columns, you can specify them in the columns
property.
Complete Example
Here's a complete example showing how to use the DataTable
component in a page: