MUI Tables
  • Overview | MUI Tables
  • Playground
  • Options & Types
    • Top Level Props
    • Defaults
    • ColumnOptions
    • TranslationOptions
  • Features
    • Row Merging & Duplication
    • Custom Components
    • Event Hooks
Powered by GitBook
On this page
  • MUITable Props
  • ColumnOptions
  • DisplayOptions
  • ToolbarOptions
  • RowOptions
  • PaginationOptions
  • TranslationOptions
  • HookOptions

Was this helpful?

  1. Options & Types

Top Level Props

PreviousOverview | MUI TablesNextDefaults

Last updated 6 years ago

Was this helpful?

MUITable Props

The is a great way to see all of the options in action.

<MUITable 
    title="Test"
    data={[]}
    loading={false}
    columns={ColumnOptions}
    toolbar={ToolbarOptions}
    rows={RowOptions}
    pagination={PaginationOptions}
    translations={TranslationOptions}
    hooks={HookOptions}
    display={DisplayOptions}
/>    
    

Prop

Type

Required

Default

title

ReactNode

✅

n/a

data

Object[]

✅

n/a

loading

boolean

❌

false

ColumnOptions

✅

n/a

DisplayOptions

❌

DisplayOptionsDefault

ToolbarOptions

❌

ToolbarOptionsDefault

RowOptions

❌

RowOptionsDefault

PaginationOptions

❌

PaginationOptionsDefault

TranslationOptions

❌

TranslationOptionsDefault

HookOptions

❌

HookOptionsDefault

ColumnOptions

Prop

Type

Description

Required

Default

ColumnProp[]

Column definitions

✅

n/a

GeneratedColumn[]

Define columns generated from the data set

❌

[]

sortColumns

(columns: StateColumn[]) => StateColumn[]

Function to sort the order of the columns once generated. Especially useful with GeneratedColumns

❌

[]

DisplayOptions

None of these are required. These are all of the highest level functionality options

Prop

Type

Description

Default

boolean

Allow sorting

true

paginate

boolean

Pagination footer

true

filter

boolean

Filter toolbar

true

fixedSearch

boolean

Fixed search bar under title

false

search

boolean

Button to toggle search bar

true

download

boolean

Download button

false

fixedHeader

boolean

Fixed column headers

true

viewColumns

boolean

Ability to toggle column visibility

true

elevation

number

Paper elevation for entire table

4

responsive

"stacked" |

"scroll"

Wrap or horizontal scroll overflow

'scroll'

filterValues

boolean

Show current filters as chips under top toolbar

true

ToolbarOptions

Prop

Type

Description

Required

Default

showDates

boolean

Show the date toolbar?

✅

false

startDate

Date

If showDates and not provided, start date picker won't render

❌

undefined

endDate

Date

If showDates and not provided, end date picker won't render

❌

undefined

handleDateChange

(isStart: boolean) => (value: Date) => void

Called first with isStart, and should return change handler.

showDates === true

n/a

startLabel

string

Label for start date picker

❌

"Start Date"

endLabel

string

Label for end date picker

❌

"End Date"

customToolbarRight

(context: MUITableContext) => ReactNode

❌

undefined

customToolbarLeft

(context: MUITableContext) => ReactNode

❌

undefined

customToolbarBottom

(context: MUITableContext) => ReactNode

❌

undefined

customToolbarFull

(context: MUITableContext) => ReactNode

❌

undefined

RowOptions

None of these are required.

Prop

Type

Description

Default

rowHover

boolean

Shade rows on hover

false

showSummaryRow

boolean

Show summary row

false

selectable

boolean

Selectable rows?

false

summaryTop

boolean

Show summary at top?

true

setRowProps

(row: Row, rowIndex: number) => Object

Set props on the standard MUI TableRow component

undefined

customToolbarSelect

(selectedRows: Row[], context: MUITableContext) => ReactNode

Render a custom toolbar when rows selected

"End Date"

selectBarTop

boolean

Show the selected rows toolbar in top of table

true

selectBarActions

(context: MUITableContext) => ReactNode

undefined

hideSelectDelete

boolean

Hide the default delete button in selected toolbar

false

skipDuplicates

boolean

See Row Merging / Duplication

false

mergeDuplicates

boolean

See Row Merging / Duplication

false

mergeFunction

(rows: Row[]) => Row

See Row Merging / Duplication

undefined

hiddenColumnMerge

boolean

See Row Merging / Duplication

false

PaginationOptions

None of these are required.

Prop

Type

Description

Default

page

number

Initial page. Will not affect subsequent renders if changed.

0

rowsPerPage

boolean

Initial rowsPerPage. Will not affect subsequent renders if changed.

5

rowsPerPageOptions

number[]

Choices for rowsPerPage

[5,25,50]

customFooter

(context: MUITableContext) => ReactNode

Render a custom footer instead of pagination.

undefined

TranslationOptions

HookOptions

None of these are required.

{
    onSearchChange?: (searchText: string) => void;
    onRowsSelect?: (
        newSelections: Row[],
        removedSelections: Row[],
        currentSelections: Row[]
    ) => void;
    onRowsDelete?: (rowsDeleted: Row[]) => void;
    onFilterChange?: (change: string | string[], filterList: string[][]) => void;
    onRowClick?: (row: Row, rowIndex: number) => void;
    onCellClick?: (cell: Cell, row: Row, rowIndex: number) => void;
    onColumnSortChange?: (changedColumn: StateColumn, direction: 'asc' | 'desc' | null) => void;
    onColumnViewChange?: (changedColumn: StateColumn, visible: boolean) => void;
    onChangePage?: (currentPage: number) => void;
    onChangeRowsPerPage?: (numberOfRows: number) => void;
}

ort

configurable example
Expanded in Column Options page
See the TranslationOptions page for all the text labels.
translations
See Custom Components.
See Custom Components.
See Custom Components.
See Custom Components.
See Custom Components.
columns
display
toolbar
rows
pagination
hooks
static
generated
s