Interface DataTableProps<Row>

interface DataTableProps<Row = DefaultRow> {
    className?: string;
    columns: ColumnDefinition<Row>[];
    components?: Partial<DataTableComponents>;
    data: Row[];
    icons?: Partial<DataTableIcons>;
    options?: Partial<DataTableOptions<Row>>;
    paperProps?: PaperProps;
    ref?: Ref<HTMLDivElement>;
    textLabels?: Partial<
        {
            body: Partial<{ noMatch: ReactNode; toolTip: string }>;
            filter: Partial<{ all: string; reset: string; title: string }>;
            pagination: Partial<
                {
                    displayRows: string;
                    jumpToPage: string;
                    next: string;
                    previous: string;
                    rowsPerPage: string;
                },
            >;
            selectedRows: Partial<
                { delete: string; deleteAria: string; text: string },
            >;
            toolbar: Partial<
                {
                    downloadCsv: string;
                    filterTable: string;
                    print: string;
                    search: string;
                    viewColumns: string;
                },
            >;
            viewColumns: Partial<{ title: string; titleAria: string }>;
        },
    >;
    title?: ReactNode;
}

Type Parameters

Properties

className?: string

Pass and use className to style <DataTable /> as desired

columns: ColumnDefinition<Row>[]

Columns used to describe table

components?: Partial<DataTableComponents>

Override <DataTable /> components

data: Row[]

Data used to populate <DataTable />

 const data = [
['Gabby George', 'Business Analyst', 'Minneapolis'],
['Aiden Lloyd', "Business Consultant", 'Dallas'],
['Jaden Collins', 'Attorney', 'Santa Ana'],
// ....
];
icons?: Partial<DataTableIcons>

Override <DataTable /> icons

options?: Partial<DataTableOptions<Row>>
paperProps?: PaperProps

Override Material UI's <Paper /> props that wrap the <DataTable />

ref?: Ref<HTMLDivElement>
textLabels?: Partial<
    {
        body: Partial<{ noMatch: ReactNode; toolTip: string }>;
        filter: Partial<{ all: string; reset: string; title: string }>;
        pagination: Partial<
            {
                displayRows: string;
                jumpToPage: string;
                next: string;
                previous: string;
                rowsPerPage: string;
            },
        >;
        selectedRows: Partial<
            { delete: string; deleteAria: string; text: string },
        >;
        toolbar: Partial<
            {
                downloadCsv: string;
                filterTable: string;
                print: string;
                search: string;
                viewColumns: string;
            },
        >;
        viewColumns: Partial<{ title: string; titleAria: string }>;
    },
>

User provided labels to localize text.

title?: ReactNode

Title of the table