Materialish

Table

Tables present structured information.

🙌 Heads up! This code is editable. The preview above will update to reflect your changes.

Usage

import { Table } from 'materialish';
import 'materialish/materialish.css';

Table

Props

Prop NameDefault ValueDescription
classNameAdditional class name(s) to add to the menu
childrenTable.Head and/or Table.Body elements to render within the table
nodeRefPass a ref to get access to the root node
...restOther props are placed on the underlying ul element of the menu

CSS Variables

VariableDefault ValueDescription
--mt-baseFontSize1remThe size of text within the table
--mt-fontFamily'Roboto'The font family to use for text
--mt-table-cellHeightThe height to use for table cells

Table.Head

Props

Prop NameDefault ValueDescription
classNameAdditional class name(s) to add to the table head
childrenA Table.HeadRow element to render within the table head
nodeRefPass a ref to get access to the root node
...restOther props are placed on the root element of the table head

Table.HeadRow

Props

Prop NameDefault ValueDescription
classNameAdditional class name(s) to add to the table head row
childrenAn array of Table.HeadCell elements to render within the table head row
nodeRefPass a ref to get access to the root node
...restOther props are placed on the root element of the table head row

Table.HeadCell

Props

Prop NameDefault ValueDescription
classNameAdditional class name(s) to add to the table head cell
childrenAn array of Table.HeadCell elements to render within the table head cell
widthThe width to use for this column. This value will be inherited by the other cells in this column.
rightBorderfalseWhether or not to render a border to the right of this cell. This value will be inherited by the other cells in this column.
nodeRefPass a ref to get access to the root node
...restOther props are placed on the root element of the table head cell

Table.Body

Props

Prop NameDefault ValueDescription
classNameAdditional class name(s) to add to the table body
childrenAn array of Table.Row elements to render within the table body
nodeRefPass a ref to get access to the root node
...restOther props are placed on the root element of the table body

Table.Row

Props

Prop NameDefault ValueDescription
classNameAdditional class name(s) to add to the table row
childrenAn array of Table.Cell elements to render within the table row
nodeRefPass a ref to get access to the root node
...restOther props are placed on the root element of the table row

Table.Cell

Props

Prop NameDefault ValueDescription
classNameAdditional class name(s) to add to the table cell
childrenThe contents of the table cell
widthInheritedThe rendered width of the cell. This will be provided for you when you specify it on this column's HeadCell
rightBorderInheritedWhether or not to render a border to the right of this cell. This will be provided for you when you specify it on this column's HeadCell
nodeRefPass a ref to get access to the root node
...restOther props are placed on the root element of the table cell

Table.ExpandedRowContent

Expanded row content should be used as a sibling of a Table Cell.

Props

Prop NameDefault ValueDescription
classNameAdditional class name(s) to add to the expanded row content
childrenAn array of Table.Cell elements to render within the expanded row content
openfalseWhether or not to display the expanded content
nodeRefPass a ref to get access to the root node
...restOther props are placed on the root element of the expanded row content

Useful Links