Introduction
The Table format organizes data in rows and columns, providing a clear view for comparison and detailed analysis. It’s ideal for displaying precise values.
Syntax
You can use either Table or QueryTable to visualize query results in a table format.
Use QueryTable when you want the component to automatically handle the query fetching.
Use Table when you already fetched the data using useQuery.
import { QueryTable } from '@latitude-data/react';
function MyComponent() {
return (
<QueryTable
queryPath='sorted_titles'
params={
limit: 10
}
/>
);
}
Properties
Depending on the component you choose, you can pass the following properties:
Query configuration
The path to the query file that will provide the data displayed in the table.
An object with custom parameters to be used in the query.
A flag to enable the download of the table data as a CSV file.
Data configuration
The data to be displayed in the table. It should be an array of objects, where each object represents a row in the table.
A flag to indicate if the data is still loading. When set to true, the table will display a blinking animation.
An error message to be displayed in case the data could not be loaded.
A function to download the table data as a CSV file.
Style
You can add a brief description of your table.