Function Table

  • Parameters

    Returns Element

    A table component wrapper for MUI Table.

    import Table, { body, row, head } from 'muitils/Table';
    <Table
    head={head(
    {value: 'Name'},
    {value: 'Age'}
    )}
    data={body(
    row({sx:{color:'red'}}, [
    {value: 'Michael'}, {value: 142}
    ]),
    row([{value: 'Mel'}, {value: 141}])
    )}
    loadingBehavior={{rows: 5, SkeletonProps: {variant: 'text'}}}
    TableProps={{sx: {maxHeight: '500px'}}}
    TableHeadProps={{sx: {backgroundColor: 'red'}}}
    TableBodyProps={{sx: {backgroundColor: 'blue'}}}
    TableRowProps={{sx: {backgroundColor: 'green'}}}
    TableCellProps={{sx: {backgroundColor: 'yellow'}}}
    {...rest} // MuiTableProps
    />