Datatable #

Datatable for work on dataflows

import { PDatatable } from 'pearkit';

Basic #

Here is an datatable component that you can use in your projects.

10
Name
Price
Stock
SKU
Showing 1 to 0 of 0 entries
const [dataStack, setDataStack] = useState({
        products: [],
        total: 0
    });

const [isPending, setIsPending] = useState(false);
    
const dummyLoader = async (synchronizedTableState: string) => {
    setIsPending(true);
    const endpoint = 'https://dummyjson.com/products'
    const response = await axios.get(`${endpoint}${synchronizedTableState}`);
    setDataStack(response.data);
    setIsPending(false);
}
    
const config = {
    columns: [
        {name: 'Name', field: 'title'},
        {name: 'Price', field: 'price'},
        {name: 'Stock', field: 'stock'},
        {name: 'SKU', field: 'sku'}
    ],
    loader: dummyLoader,
    stack: dataStack.products,
    limit: 10,
    total: dataStack.total,
    isPending:isPending
}
    
<PDatatable config={config}/>

Accessibility (Not Ready Yet) #

None

Api #

Here you can see all the working features for the datatable component.

NameTypeDefaultDescription